Does anyone know why the output of the first snippet is bash
instead of test
?
$ bash -c "echo $0 $1" "test"
bash
$ bash -c 'echo $0' "test"
test
How can I use bash -c
with double quotes and positional parameters $1
, $2
, etc. ?
Does anyone know why the output of the first snippet is bash
instead of test
?
$ bash -c "echo $0 $1" "test"
bash
$ bash -c 'echo $0' "test"
test
How can I use bash -c
with double quotes and positional parameters $1
, $2
, etc. ?