Sometimes it is helpful to watch what a bash script is actual doing. This can be done with the parameter -x:
$ bash -x <script>
To change the directory for temporary files during sort use the parameter -T:
$ sort -T /var/big_filesystem file_to_sort
This can be helpful, if you sort a big file and the default directory (
/tmp) is full or too small.
$ bash -n <script>
Does not execute the script, checks the syntax.
Set the cursor onto a number and press
Ctrl-A to increase it or
Ctrl-X to decrease it.