Some great StackOverflow / StackExchange bash tips
Posted by jpluimers on 2017/04/06
Found these then trying to create a new feature for https://github.com/Hexxeh/rpi-update:
- For setting default values: Source: bash – Using “${a:-b}” for variable assignment in scripts – Unix & Linux Stack Exchange
- bash – variable expansion in curly braces – Stack Overflow
- Use the && (and) and || (or) operators and double brackets: if statement – groups of compound conditions in Bash test – Stack Overflow
- Only supported in bash and ksh: Is [[ ]] preferable over [ ] in bash scripts? – Stack Overflow
–jeroen






Leave a comment