Quote:
Originally Posted by Franklin52
Try this:
Code:
ls -l |awk '/^-/ && $NF !~ /^abc/ && $NF !~ /^efg/ {print $NF}'
|
Thanks Frank when I assign this code to a variable and try to print the variable contents it just prints nothing.
I do this:
FILELIST=`ls -l |awk '/^-/ && $NF !~ /^abc/ && $NF !~ /^efg/ && $NF ~ /.out/ {print $NF}'`
echo $FILELIST
Neither does this work:
FILELIST=`echo ls -l |awk '/^-/ && $NF !~ /^abc/ && $NF !~ /^efg/ && $NF ~ /.out/ {print $NF}'`
echo $FILELIST
Please help..Ideally it shold be printing the file name whose extension is .out and not begining with abc or efg