linux - storing awk results to bash ${} data format -
i got question bash , awk, so, i'm going filter processes list ps aux
did filtering grep
, filter again using awk
display pid , path of process, save corresponding ${pid}
, ${path}
field. question is, when done filtering results using awk, i'm going save results on ${pid}
pid numbers , ${path}
process's path, got no idea @ on doing thing. if here have solution appreciated.
thanks
edit: here code
ps aux | grep 'firefox' | awk '{print $2 " " $11}'
then don't know save $2
content ${pid}
, $11
${path}
, save fields txt file again...
if else fail remember have disk can use. pipe result file , process file using awk
or cut
2 times assign fields corresponding variables.
for example:
$result > tmp pid=`cat tmp | cut -f 1` path=`cat tmp | cut -f 2` rm tmp
Comments
Post a Comment