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:
- parsing
lsoutput should avoided - use of
evalshould minimised
Comments
Post a Comment