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
For output from multi-line command, you can do this:
output=$( #multiline multiple commands )
Or:
output=$(bash <
Example:
#!/bin/bash output="$( ./a.out params1 ./a.out params2 echo etc.. )" echo "$output"