do sleep

how this command: for i in {1..5}; do sleep 600 & done
for i in {1..5}; do something done

That's a for loop in bash. The something can be a single statement, or a group of statements run in a sub-shell with ().

A trivial example is:
for i in {1..3}; do echo "i=$i"; done


The next part of your question is looking at the actual something, sleep 600 &

Most modern shells can run a program in the background. There something called "Job Control" that covers how shells deal with this. There's always one foreground task, if nothing's running, it's the shell, but you can have zero or more background tasks. You can see your background tasks with jobs.

To background a task, prepend it with &. You can also background the foreground task by typing Ctrl-z.

And as for sleep 600?
Last edited on
Topic archived. No new replies allowed.