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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -