Set
S=2
then,
echo $S
= echo "$S"
=
bash -c " echo $S "
=
bash -c " echo '$S' "
=
bash -c " echo "$S" "
the most confusing one for me is bash -c " echo '$S' "
since echo '$S'
= $S
How bash -c " echo '$S' "
works like others?
Set
S=2
then,
echo $S
= echo "$S"
=
bash -c " echo $S "
=
bash -c " echo '$S' "
=
bash -c " echo "$S" "
the most confusing one for me is bash -c " echo '$S' "
since echo '$S'
= $S
How bash -c " echo '$S' "
works like others?
echo
commands are different ways of doing the same thing, outputting the value of theS
variable tostdout
, normally the terminal display. – Brian Aug 25 '21 at 23:57