Casper.Dik at Sun.COM wrote: > > >Fixed - see below... > > > >> - this is caused by calling: > >> > >> cmd=$(basename "$0") > >> > >> - and I noticed that it didn't happen when I use: > >> > >> cmd=${0##*/} > > > >Mhhh, this works because there is no PATH lookup required to find the > >matching command... > > That's not the entire story. > > basename "$0" - no stat'ing .paths > cmd=$(basename "$0") - stating .paths
Uhm... right now I have no clue... I have to crawl around in the source a bit (it seems that changing $(...) to ${...;} causes lookups for ".paths", too - which rules out that the subshell code is causing this) ... > >The idea was to rename the PATH variable (e.g. via $ typeset -m ... #) > >to something like "saved_path" and later do a $ PATH="${saved_path}" > >"${cmd}" "$@" # which would have a similar effect... > >... but your solution is shorter (and works since "sleep" is not bound > >to a specific PATH element). > > And the other commands alias'ed to "alias"? Seems to be fixed for them, too: -- snip -- $ (for i in sleep kill test alias printf command alias fg bg jobs ; do print "## $i" ; rm -f /tmp/yyy ; truss -o /tmp/yyy $ROOT/usr/bin/jobs ; fgrep ".path" </tmp/yyy ; done) ## sleep ## kill ## test ## alias ## printf ## command ## alias ## fg ## bg ## jobs -- snip -- What else needs to be fixed (excluding [1]) ? [1]=CR #6807629 ("sleep: time argument should ignore LC_* variables") may require ask the Austin Group how to interpret the POSIX/SUS standard in this case. IMO "sleep"'s argument should use LANG/LC_NUMERIC/LC_ALL (in that order) for parsing it's arguments like |libc::strtod()| and |libc::sscanf()| do (otherwise there is the question how a shell with floating-point support for ((<arithmetric-expression)) should look at LANG/LC_NUMERIC/LC_ALL, too (which ksh93 does)). ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;)