Bash stdout redirection
I have code in a bash shell which writes to stdout as it runs.
This is a contrived example ... Code:
echo How is this done? Maybe something like this ... Code:
echo |
One way to do it:
Code:
echo "This goes to stdout" |
Quote:
Daniel B. Martin |
|
I would use the exec option from the link above as well :) The nice part is you can put all the execs in the same piece of code and then use them when required.
On the other side of the fence, the original suggestion is actually a lot less typing and you could just use variables for the 3 file names. |
Also, commonly, "informational" messages are written to STDERR while "output" goes to STDOUT. By default both are directed to the terminal screen.
|
Quote:
Daniel B. Martin |
All times are GMT -5. The time now is 08:52 PM. |