Reputation: 6204
Im trying to store the output of a set of commands to a variable in a shell script. The obvious backticks and eval are failing. Could someone help me out with this.
I want to store the output of
head -"$errno" tmptmptmp2 | tail -1 | sed 's/,//'
into a variable.
The command works fine BTW.
Upvotes: 1
Views: 125
Reputation: 455000
You can do:
var=$(head -"$errno" tmptmptmp2 | tail -1 | sed 's/,//')
Upvotes: 2