Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20299860: zdiff unix utility expects BSD Bourne shell, not GNU BASH. #1640

Open
openradar-mirror opened this issue Aug 3, 2015 · 0 comments

Comments

@openradar-mirror
Copy link

Description

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:

Product Version: 10.10.2 (14C1514)
Created: 2015-03-25T22:21:31.920541
Originated: 2015-03-25T00:00:00
Open Radar Link: http://www.openradar.me/20299860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant