On Tue, Oct 10, 2006 at 06:14:22PM -0500, mwoehlke wrote:
[...]
$ zsh -c 'echo "`/dev/null 2>&1`"' bash
bash: /dev/null: Permission denied
$ zsh
$ ARGV0=bash ash -c 'echo "`/dev/null 2>&1`"; echo $BASH'
bash: /dev/null: Permission denied
Eh? I get:
$ zsh -c 'echo "`/dev/null 2>&1`"' bash
zsh:1: permission denied: /dev/null
Well, I do get what I said with zsh 4.3.2
$ ARGV0=bash ash -c 'echo "`/dev/null 2>&1`"; echo $BASH'
/dev/null: permission denied
(note that this command must be run from zsh which uses
ARGV0=... to set ash's argv[0]).
You must have an older /ash/ than I have mine is one of the
OpenBSD based sh ones (found on debian).
So neither of your counter-examples is working for me (although both
look like they *should*; go figure).
Though I'd bet the third one with .zshenv worked.
But since you didn't counter
BASH_SUBSHELL (and since I'm too lazy to change it now) I guess I'll
stick with that. :-)
BASH_SUBSHELL is a relatively recent addition to bash. Most
systems still don't have a bash3.
$ bash -c 'echo "$BASH_VERSION, <$BASH_SUBSHELL>"'
2.05b.0(2)-release, <>