How to print literal string "$1" in bash script? -
i want print string called "$1". when echo prints string equals "$1" variable. how can print "$1" string?
for example:
set -- "output" # sets $1 "output" echo $1 # ==> output
but want this:
echo $1 # ==> $1
you have escape $
have shown:
$ echo "\$1"
or, noted jeremyp in comments, use single quotes value of $1
not expanded:
$ echo '$1'
Comments
Post a Comment