in reply to storing system function output

Use backticks. See this example (conveniently using ls ;-)

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.