sandbox:shell-scripting
This is an old revision of the document!
Table of Contents
Shell scripting
Here will be some useful examples and snippet
Links
- Bash single quotes and double quotes: https://askubuntu.com/a/605440
- Prevent CRON from overlapping: https://ma.ttias.be/prevent-cronjobs-from-overlapping-in-linux/
- bash colors: https://stackoverflow.com/a/28938235/4485894
Debug scripts
# sh -x some-script-name.sh
Differences between single and double quotes
Single quotes won't interpolate anything, but double quotes will. For example: variables, backticks, certain \ escapes, etc.
$ echo "$(echo "upg")" upg $ echo '$(echo "upg")' $(echo "upg")
sandbox/shell-scripting.1556225185.txt.gz · Last modified: 2019/04/25 23:46 by dreiggy