`zdiff` unix utility expects BSD Bourne shell, not GNU BASH.

Originator:hplogsdon
Number:rdar://20299860 Date Originated:25-Mar-2015
Status:open Resolved:
Product:OS X Product Version:10.10.2 (14C1514)
Classification:UI/Usability Reproducible:Always
 
Summary:
Running the built in `zdiff` unix utility to compare the difference between two compressed files fails.

Steps to Reproduce:
1. Create a text file. (e.g. run `echo "Hello, World!" > example.txt` from Terminal.app)
2. Compress that text file with the unix utility `gzip`, keeping the original. (e.g. run `gzip --keep --stdout example.txt > a.gz` from Terminal.app)
3. Alter the text file (e.g. run `echo "Goodbye, World :(" > example.txt` from Terminal.app)
4. Again, compress the text file with the same utility as in step 2, changing the filename (e.g. run `gzip --keep --stdout example.txt > b.gz` from Terminal.app)
5. Run the command `zdiff a.gz b.gz`

Expected Results:
The terminal should print the differences between the two compressed text files.

Actual Results:
The terminal fails with a number of errors:

[howard@int-osx-prod1 ~]% zdiff ~/production.sql.gz ~/development.sql.gz
/usr/bin/zdiff: line 49: setvar: command not found
/usr/bin/zdiff: line 50: setvar: command not found
/usr/bin/zdiff: line 49: setvar: command not found
/usr/bin/zdiff: line 50: setvar: command not found



Version:
Mac OS X Yosemite 10.10.2 (14C1514)

Darwin int-osx-prod1 14.1.0 Darwin Kernel Version 14.1.0: Thu Feb 26 19:26:47 PST 2015; root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64

Notes:
Running the same test on a FreeBSD server returns the expected results.

[howard@ext-bsd-a13 ~]> uname -a
FreeBSD ext-bsd-a13.hplogsdon.net 9.3-STABLE FreeBSD 9.3-STABLE #1 r277307: Sat Jan 17 19:11:50 MST 2015     root@int-fbsd-build.hplogsdon.net:/usr/obj/usr/src/sys/HPLOGSDON_NET  i386
[howard@ext-bsd-a13 ~]> echo "Hello, World!" > example.txt
[howard@ext-bsd-a13 ~]> gzip -k -c example.txt > a.gz
[howard@ext-bsd-a13 ~]> echo "Goodbye, World :(" > example.txt
[howard@ext-bsd-a13 ~]> gzip -k -c example.txt > b.gz
[howard@ext-bsd-a13 ~]> zdiff ~/a.gz ~/b.gz
1c1
< Hello, World!
---
> Goodbye, World :(

the shell /bin/sh on OS X, is a link to /bin/bash, the GNU Bourne Again Shell (GNU Bash-3.2). On FreeBSD /bin/sh's manpage states that it's version is the rewritten version modeled after Bourne shell from AT&T System V Release 4 UNIX. FreeBSD's `sh` manpage reference a "setvar" command, where as GNU's BASH does not.

Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!