in reply to run command & get output

This FAQ has been asked and answered many many times.

Just try typing "command output" in the search box (at the top of every page) for over 100 writeups.

HTH