5,321
edits
Line 88: | Line 88: | ||
ls &> file.txt # Only works in bash, not sh | ls &> file.txt # Only works in bash, not sh | ||
</syntaxhighlight> | |||
===Trap=== | |||
To make a bash script exit on ctrl c: | |||
<syntaxhighlight lang="bash"> | |||
trap "exit" INT | |||
</syntaxhighlight> | </syntaxhighlight> | ||