From Bash Manual
bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o option] [-O shopt_option] -c string [argument ...]
-cRead and execute commands from the first non-option argument after processing the options, then exit. Any remaining arguments are assigned to the positional parameters, starting with
-can option which takes an option argument or doesn't take any option argument? I guess it takes an option argument.
Why does it say
-cRead and execute commands "from the first non-option argument" instead of "from the option argument to
For example, in the following command, is
mycommandan option argument to option
bash, or a non-option argument to
bash -c mycommand
Does "Any remaining arguments" mean all the non-option arguments to
In the following command, is it correct that the non-option arguments
bashare passed by
mycommandand are used as command line arguments to
bash -c mycommand arg1 arg2
Are the following two commands equivalent? What is the difference between them?
bash -c mycommand arg1 arg2 bash -c 'mycommand arg1 arg2'