What is the point of the "null" operator in a BASH script? I understand that it is used as a placeholder following an if
command when you have nothing to say, but need a command to allow the program to run properly. But what is the overall use for it? When would you use it? When does it make sense to use it?
Ubuntu – The point of the bash Null-operator “:”, colon
bashscriptssyntax
Related Question
- Bash Scripts – Differences Between Terminal Command-Line and Bash Script Environments
- Ubuntu – How to create a bash scrip that calls other scripts depending on commandline swith
- Command-Line – Prevent Output from ‘&’ and ‘>’ Operators
- Fix ‘date: command not found’ Error in Bash Script
- Ubuntu – How to stop the bash script when a condition fails
- Ubuntu – the purpose of the special parameter “_” (single underscore) in environment
Best Answer
It's sometimes useful to allow parameter expansions side-effects to occur.
For example, setting a default value