I am having trouble coming up with the right combination of semicolons and/or braces. I\'d like to do this, but as a one-liner from the command line:
while [
You don't even need to use do and done. For infinite loops I find it more readable to use for with curly brackets. For example:
do
done
for
for ((;;)) { date ; sleep 1 ; }
This works in bash and zsh. Doesn't work in sh.
bash
zsh
sh