Bash script capturing output to terminal

Viewed 16160

I want to capture into my bash script (in a variable) the output of some command that prints its output to terminal. I have tried the following:

TEST_OUT=`the_command ARG1`   #Nope

#Putting the line "the_command ARG1" into a separate script, testing2.sh,

TEST_OUT=$(./testing2.sh)   #Nope

testing2.sh
TEST_OUT=$?  #Nope

I am 100% sure that when I run...

> the_command ARG1

...in a terminal, it prints to the terminal exactly the information I want to capture.

Thank you for any help!

1 Answers
Related