ls | awk '{print "'\''"$1"'\''"}'
or
awk 'BEGIN { print "Here is a single quote \47" }'
Tuesday, May 13, 2008
Linux:Bash:how to print quotation marks in awk
Subscribe to:
Post Comments (Atom)
The life is too short to be little.
ls | awk '{print "'\''"$1"'\''"}'
or
awk 'BEGIN { print "Here is a single quote \47" }'
4 comments:
And how to print a double quotation mark (")?
As
# ls | awk '{print "'\"'"$1"'\''"}'
doesn't work.
Even simpler:
ls | awk '{print "\""$1"\""}'
awk '{print "\047between double quotes\047"}'
sorry \47
Post a Comment