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
- Ubuntu – How do the environments of a standard Terminal command-line and a bash script differ
- Ubuntu – How to create a bash scrip that calls other scripts depending on commandline swith
- Ubuntu – How to prevent output from ‘&’ and ‘>’ operator (send to background operator and redirection operator)
- Ubuntu – running a bash file states:date: command not found
- 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