Quantcast
Channel: Active questions tagged bash+awk - Ask Ubuntu
Viewing all articles
Browse latest Browse all 102

How can I store the output of an awk command as a bash script variable? [duplicate]

$
0
0

This question already has an answer here:

When operating in the linux terminal I can enter the following: command

''' awk 'FNR==1 {print$5}' SNextractedstats.txt '''

To display the value in the first row and fifth column of a text file.

I would like to be able to save this value as a variable in a bash script to be able to do sums and call using Echo, how would I go about doing this? Thank you


Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>