Some things you should do in scripts:
Set the PATH manually in your scriptSet the IFS manuall: IFS=' 'set -o noglob switch off filename expansionset -o noglob switch off filename expansionUse unset for every variable before you use it.Check every argument to see if it meets the required specifications:
user=${1##*[ \\$/;()|\>\<& ]}Do not use eval in your scriptsBefore you create a file, add a trap on EXIT to delete it if the script abortsDo not use temporary files!
Arguments
The 10th argument: ${10} NOT $10!!!Setting the arguments new: set foo barSetting arguments with "-" set --fooDeleting all old arguments set --
Backquotes
command1 ${comand2} executes command2 and uses the return value to start command1