In the answer to this question about comments in shell scripting, it is indicated that the :
is a null command that explicitly does nothing (but is not to be used for comments).
What would be the utility of a command that does absolutely nothing?
shellshell-script
In the answer to this question about comments in shell scripting, it is indicated that the :
is a null command that explicitly does nothing (but is not to be used for comments).
What would be the utility of a command that does absolutely nothing?
Best Answer
I typically use
true
in loops; I think it's more clear:The one place I've found that
:
is really handy is in case statements, if you need to match something but don't want to actually do anything. For example: