Hi guys,
Besides the points bellow, what would best practices for scripting be ?
1) set the PATH
2) unset the current environment (set -u ?)
3) (re)set the IFS to default value - space (IFS="" <- is this correct ?)
4) check the return code for each action inside the script (cd, rsync, cp, mv, etc)
5) use quotes around variables (avoid white spaces - ex: "$var")
6) always indent (for, while, until, case, etc) loops
Thx for taking the time to answer.
da1,
script kiddie trying to learn the correct way of scripting