Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
linux:pipe [2019/06/05 11:40] – [Pipe to a file] tmade | linux:pipe [2020/09/16 11:24] – [Execution Dependency] tmade |
---|
| |
ls /opt/ /otherfile > file 2>&1 #Redirect standard error output and standard output and to "file" | ls /opt/ /otherfile > file 2>&1 #Redirect standard error output and standard output and to "file" |
ls /opt/ /otherfile > file 1>&2 #Redirect standard output to | programm &> file #Redirect stdout AND stderr to "file" |
echo "This is a test" 1> /dev/null #Redirects standard output to /dev/null | echo "This is a test" 1> /dev/null #Redirects standard output to /dev/null |
ls xyz > info.txt 2> error.txt #Output of ls will be redirected to "info.txt" (stdout) and if there is an error output (stderr) to "error.txt" | ls xyz > info.txt 2> error.txt #Output of ls will be redirected to "info.txt" (stdout) and if there is an error output (stderr) to "error.txt" |
command1 && command2 #Command2 is only executed if command1 completed without errors | command1 && command2 #Command2 is only executed if command1 completed without errors |
command1 || command2 #Command2 is only executed if command1 completed with an error | command1 || command2 #Command2 is only executed if command1 completed with an error |
| command1 && command2 || command3 # |
| |
==== Error-handling ==== | ==== Error-handling ==== |