Paul Jarc wrote:
mwoehlke <[EMAIL PROTECTED]> wrote:
I *know* '! [ -a file ]' is not portable. I tried to use it in some script, somewhere, at some time, and it was sometimes treated as history expansion.

Quoting the "!" would take care of that particular problem, but there
are some older shells, like Solaris /bin/sh, where the "!" command
doesn't exist at all, so if this script will have to run in anything
but bash, it'd still be good to use one of the other methods.

Hehe, yeah, I have to maintain scripts that run under "/bin/sh" on... oh, about nine different platforms. :-) That's always a frustrating exercise in portability, and not just w.r.t. the shell. For instance, there is one script that breaks with certain non-GNU versions of 'awk' and 'tail', and there have been plenty of times I've put in conditional code. Heck, I've even done conditional code based on the version of bash! :-)

--
Matthew
vIMprove your life! Now on version 7!



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to