Re: [RFD] Combined fork-exec syscall.

Valdis.Kletnieks@vt.edu
Mon, 28 Apr 2003 10:38:14 -0400


--==_Exmh_-1467049834P
Content-Type: text/plain; charset=us-ascii

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?

--==_Exmh_-1467049834P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001

iD8DBQE+rTzWcC3lWbTT17ARAv2BAJ4o+c3b+HuL3iew1texOep99wq5fACgt1t1
4kSfc6aWdBo8HdZ3NY0i4lI=
=Jmbh
-----END PGP SIGNATURE-----

--==_Exmh_-1467049834P--
-
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/