Messages in this thread | ![/](/images/icornerl.gif) | | Subject | Re: [RFD] Combined fork-exec syscall. | From | Valdis.Kletnieks@vt ... | Date | Mon, 28 Apr 2003 10:38:14 -0400 |
| |
On Mon, 28 Apr 2003 10:16:21 EDT, "Richard B. Johnson" said:
> Read the bash documentation `man bash`. The first argument becomes > $0 (the process name), the second becomes $1, etc. Please don't > just keep assuming that I don't know what I'm talking about. > > $ sh -c 'ignore echo a b c' > Works fine.
[~]2 /bin/bash -c ignore echo a b c echo: line 1: ignore: command not found [~]2 /bin/bash -c 'ignore echo a b c' /bin/bash: line 1: ignore: command not found
Obviously, tokenization makes a difference here. ;)
So let's try forcing $0 to /bin/bash rather than 'ignore'...
[~]2 sh -c '/bin/bash echo a b c' echo: /bin/echo: cannot execute binary file
Correct, but unexpected results..
[~]2 sh -c /bin/echo echo a b c
[~]2 sh -c '/bin/echo a b c' a b c
Again, tokenization matters - try working out what the value of argc is for the exec of /bin/bash for each of these cases...
Dick, do you have an 'ignore' in your $PATH?
[unhandled content-type:application/pgp-signature] | ![\](/images/icornerr.gif) |