Using BladeLogic NSH (Simliar to ZSH)...
System Variables:
x=myserver
y=myfile
contents of myfile:
cat
dog
bunny
Desired output:
"myserver","myfile","cat
dog
bunny" ^ENDOFRECORD^
This is what I'm getting:
"myserver","myfile","cat
dog
bunny
" ^ENDOFRECORD^
System Variables:
x=myserver
y=myfile
Code:
awk 'BEGIN{OFS=","}{if (NR < 2) print "\042""'"$x"'""\042","\042""'"$y"'""\042","\042"$0; else print $0}END{print "\042"" ^ENDOFRECORD^"}' //${x}//usr/openv/netbackup/${y} >> //myserver/tmp/inprogress/exclude.final
contents of myfile:
cat
dog
bunny
Desired output:
"myserver","myfile","cat
dog
bunny" ^ENDOFRECORD^
This is what I'm getting:
"myserver","myfile","cat
dog
bunny
" ^ENDOFRECORD^