Thursday, 15 July 2010

bash - How to print variable inside awk -


I want to interpret awk as a variable

  #! / Bin / bash file = tau f = 2.54 command = also awk '{sum = = $ 2}; END {print '$ {file} _ $ {f} _ $ {order} _v1.xls', sum / nr}' $ {file} _ $ {f} _ $ {order} _v1.xls & gt; & Gt; Secure / P-State Summary XL  

I want the desired output as follows -

  tau_2.54_even_v1.xls yoga / nr  

Can anyone help me with it?

I think this is what you want: > #! / Bin / bash file = tau f = 2.54 command = also awk "{sum + = \ $ 2}; END {print \" $ {file} _ $ {f} _ $ {order} _v1.xls \ ", sum / Nr} "\ $ {file} _ $ {f} _ $ {order} _v1.xls> & Gt; Secure / P-State-Summary Xls


No comments:

Post a Comment