Can any one tell me how to return the output of a program in a variable from command line?
var = ./a.out params
I am trying to get the outp
To save the program output to stdout in variable in Unix shell, regardless of language program wrote in, you can use something like this
stdout
var=`./a.out params`
or this
var=$(./a.out params)
Remember not to put spaces before or after the = operator.
=