Printing single quotes with awk
Hi,
I have the following command, which works fine:
ll /backup/PROD |grep PROD_ |awk -F" " '{print "catalog backuppiece /backup/PROD/"$9";"}'
The output is:
catalog backuppiece /backup/PROD/PROD_29mi42vn_1_1;
BUT... I want single quotes in the result. One before /back.. and one before the ;
Like this:
catalog backuppiece '/backup/PROD/PROD_29mi42vn_1_1';
How do I do that? I tried using \' but it does not work.
The following command works, but I get an error message, which prevents me from using the command in a bash file:
ll /backup/PROD |grep PROD_ |awk -F" " '{print "catalog backuppiece \'\''/backup/PROD/"$9"\'\'';"}'
awk: warning: escape sequence `\'' treated as plain `''
Regards,
Casper
|