I would like to store the output of an awk command into a variable to be used later.
I have a file called "names"
This file has the data below
first last cuid
awk '{print $2 ; }' names
will list "last"
I'd like to store that in a variable called last like below but it doesn't work
last='awk '{print $2 ; }' names'
I'd appreciate some help. I think I have to do something with the quotes to get the output of the awk to go into the variable last, but I don't know how.
I have a file called "names"
This file has the data below
first last cuid
awk '{print $2 ; }' names
will list "last"
I'd like to store that in a variable called last like below but it doesn't work
last='awk '{print $2 ; }' names'
I'd appreciate some help. I think I have to do something with the quotes to get the output of the awk to go into the variable last, but I don't know how.