1

I have a shell script written to execute tests in regression (Do_regr.sh). If I give the option -l then it displays the ip addresses of machines where regression can be run. (Do_regr.sh -l)

I want to store this output in a text file. But redirection is not working for the script. If I give Do_regr.sh -l > host_names, I see host_names is empty but the names are displayed on the screen.

What is the correct command to do this ?

1 Answer 1

1

Script must be writing it on stderr instead of stdout. Use this redirection to redirect both stdout and stderr:

Do_regr.sh -l >& host_names
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.