Re: [RFD] Combined fork-exec syscall.

From: Valdis.Kletnieks@vt.edu
Date: Mon Apr 28 2003 - 09:38:14 EST


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?



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:29 EST