A do nothing line in a bash script
The standard way to do it is using colon :
:
if condition; do
command
else
:
fi
or true
:
if condition; do
command
else
true
fi
But why not just skipping the else
part:
if condition; do
command
fi
In zsh
and yash
, you can even make the else
part empty:
if condition; then
command
else
fi
The else
statement is optional. Just type:
if [ expr ]; then
#bla
#bla
#bla
fi