Doing nothing in bash

Today I had to “do nothing” in bash. In python you have “pass” for this task. In C, you can use “;”. I found this post from someone having the same issue. He proposes either “sleep 0″ or “A=0″. However, looks like this is even nicer: from the bash manual

: [arguments]
No effect; the command does nothing beyond expanding arguments
and performing any specified redirections. A zero exit code is
returned.

So, a simple “:” will do the trick.

Post a Comment

Your email is never shared. Required fields are marked *

*
*
InspectorWordpress has prevented 1 attacks.