Linux awk string exec variable -


i have variable when echo looks this:

#echo $var awk '{print  $7 " " $6 " " $8 " "}' 

but if try like

#ls -lah | exec $var awk: '{print awk: ^ invalid char ''' in expression 

what doing wrong?

instead of exec need call eval:

ls -lah | eval $var 

however 2 cautions here:

  1. parsing ls output should avoided
  2. use of eval should minimised

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -