[plug] Bash "Processing" Script

Jay Turner jturner at bsis.com.au
Fri Jun 11 15:50:09 WST 2004


Bernd said:
> Incorrect syntax.
> 	while true
> is correct
> 	while :
> is quicker to type.

Got it.

> > If this is the case I am right in assuming that the brackets allow
> > us to group those statements together and have them all put into
> > the background?
>
> The brackets are technically redundant because the statement starts
> with "while" and is terminated by "done"; but the brackets add to
> readability (believe it or not). Brackets are used in this context,
> to create a sub-shell, which the & causes to run in background.
> Additional statements can be run in the same sub-shell by placing
> them before or after the while ... done statement; as required.

I am now reading about sub-shells - never encountered them before.
http://www.tldp.org/LDP/abs/html/subshells.html

But basically a sub-shell will allow me to run other commands and have my
script continue processing
without waiting for the sub-shelled command to finish first? cool.

I can see this coming in handy again.

Jay







More information about the plug mailing list