Upload: bash-3.0-3 [test]
Sat Jul 2 17:54:00 GMT 2005
> This is supposing /bin/sh can only be "ash" or "bash". There may be
> another /bin/sh implementation (e.g., zsh) that does support the --version
Unless somebody uses a POSIX-compatible /bin/sh that is not one of the cygwin distributions, the installed shell is distinguishable (although its version is not always discernable):
$ ash --version
Illegal option --
$ ksh --version
ksh: ksh: --: unknown option
$ pdksh --version
pdksh: pdksh: --: unknown option
$ zsh --version
zsh 4.2.4 (i686-pc-cygwin)
$ bash --version
GNU bash, version 3.00.16(2)-release (i686-pc-cygwin)
Copyright (C) 2004 Free Software Foundation, Inc.
> Actually, setup will unlink /bin/bash and then install a new /bin/bash
> over it. Thus, /bin/sh won't be upgraded even on filesystems that support
> hard links. So *it* is a showstopper of sorts...
> I'd suggest doing a binary compare on /bin/sh and /bin/bash in a preremove
> script, and deleting /bin/sh if they are the same (as is done with config
> files). This will work on both Win9x and NT-based systems.
OK. Currently, I named the postinstall 00bash.sh to ensure it runs first (since ! is legal in filenames and sorts before 0, should I change it to !!bash.sh?). I guess the corresponding thing would be as you suggest, and create a preremove named ~~bash.sh that removes /bin/sh iff it is identical to /bin/bash. I agree with your analysis that 3.0-3 will not cleanly uninstall; I will have to make a 3.0-4 before moving bash out of test (but that can wait until I have an assurance that ash will be repackaged to move to /bin/ash). Meanwhile, it is still worth uploading 3.0-3 to try it out through setup.exe.
> FWIW, there was talk about a "configure-shell" script that sets the shell
> at the user's request. Given the recent discussion of the alternatives
> package (and Buzz's executable wrappers instead of symlinks) this sounds
> like an interesting thing to try.
Is bash something that can/should be alternativized with the other sh-variants? What would I need to do to make it work cleanly?
More information about the Cygwin-apps