Man page for bash says, regarding -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.
So given that description, I would think something like this ought to work:
bash -c "echo arg 0: $0, arg 1: $1" arg1
but the output just shows the following so it looks like the arguments after the -c string are not being assigned to the positional parameters.
arg 0: -bash, arg 1:
I am running a fairly ancient bash (on Fedora 4):
[root@dd42 trunk]# bash --version
GNU bash, version 3.00.16(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
What I am really trying to do here is to execute a bit of shell script with arguments. I thought -c looked very promising, hence the issue above. I wondered about using eval but I don't think I can pass args to the stuff that follows eval. I'm open to other suggestions as well.