On 08/03/10 01:30, Mark Hobley wrote: > Some versions of the ash shell will not allow redirection to a stream number > held in a variable: > > # This construct does not work in some versions of the ash shell > echo $1 >&$2
What do these shells do? For example, if /bin/ash is where your ash lives, what does the following command do? /bin/ash -c 'set 1 2; echo $1 >&$2' >/dev/null One way to address this problem is to have Autoconf-generated scripts test whether the shell is buggy in this way, and to reject any such shell, using something like _AS_DETECT_REQUIRED([_AS_GT_AMP_VAR]) (where _AS_GT_AMP_VAR is a new macro that tests for the bug). This assumes that there is some other shell on your system that does not have the bug, and that the Autoconf-generated script will find it.