Paul A. Clarke wrote:
The man page states, for the "-c" option:
-c string If the -c option is present, then commands are read from
string. If there are arguments after the string, they are
assigned to the positional parameters, starting with $0.
I think the phrase "arguments after the string" is confusing in that the
"arguments" here are really still within "the string", not after.
I'd suggest slightly different wording, such as:
"... If argments follow the respective commands within the string, they
are..."
No, that's wrong, because it is talking about positional parameters as
seen by /the shell/, not anything that is subsequently executed.
For example, 'bash -c echo foo' does not do what you might expect. It
runs the built-in "echo" in the modified environment '0=foo'. Try e.g.
"bash -c 'echo 0=$0 @=$@' foo bar". This is not the same as subsequently
passing arguments to a program, which must be done within the *single*
argument to '-c'.
--
Matthew
Don't read this. What did I just tell you? Why are you still reading?
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash