Now I have a problem in format print in awk and redirect it to a file.
For some reasons, I need to print few command lines to a file to become a command list file.
e.g.
rsh otherhost command_here var='var with space'
I tried to use print:
print "rsh otherhost command_here var='var with space'" > "filename"
Not work.
I tried to use printf:
printf "%s\n", "rsh otherhost command_here var='var with space'" > "filename"
printf "%s%s\n", "rsh otherhost command_here var=", "'var with space'" > "filename"
Both not work.
The difficulty is printing the single quote although using backslash.
Hope someone can help.
Thanks!
tikual
For some reasons, I need to print few command lines to a file to become a command list file.
e.g.
rsh otherhost command_here var='var with space'
I tried to use print:
print "rsh otherhost command_here var='var with space'" > "filename"
Not work.
I tried to use printf:
printf "%s\n", "rsh otherhost command_here var='var with space'" > "filename"
printf "%s%s\n", "rsh otherhost command_here var=", "'var with space'" > "filename"
Both not work.
The difficulty is printing the single quote although using backslash.
Hope someone can help.
Thanks!
tikual