As above I'm running this grep command which works as it should but how do I store the returned value into a variable?
cat data.txt | grep "" |cut -d\, -f1
I tried this but it didn't work:
rig=$(cat data.txt | grep "" |cut -d\, -f1)
seems to be working for me so I will go with this unless anyone else has any pointers on how to improve the above? |
|||||||
|
grep ""supposed to do? What is the output ofecho $rig? – Stefan Seidel Sep 14 '12 at 10:00grep "" data.txt |cut -d\, -f1and it seems to be storing the value as I expect so this is working for me :) – twigg Sep 14 '12 at 10:04cut -d, -f1is sufficient. – chepner Sep 14 '12 at 13:39