1
I need to throw his output into a file instead of playing on the default output which is the screen but without me having to spell it out with the command >>
in the terminal, I want the script itself to do this.
1
I need to throw his output into a file instead of playing on the default output which is the screen but without me having to spell it out with the command >>
in the terminal, I want the script itself to do this.
3
Do it this way:
{
#seus comandos bash aqui
} > output.txt 2>&1
NOTE: If you do not specify the output path, the file will be generated in the directory in which the bash script is.
Browser other questions tagged linux bash shell-script shell
You are not signed in. Login or sign up in order to post.
where I just run it and it already auto redirects itself? Can you be clearer? It was very confusing your question.
– Tuxpilgrim
So, I want to play its output in a file instead of playing in the default output which is the screen but without me having to spell it out with the >> in the terminal,, I want the script itself to do this.
– Harry
What you want is something like:
echo $SHELL > /tmp/teste
running within the script?– Tuxpilgrim
If that’s what I understand, you can redirect what you would do in the terminal inside the script itself, setting an output file to the commands instead of the standard output.
– Tuxpilgrim