[plug] Bash "Processing" Script

Bernd Felsche bernie at innovative.iinet.net.au
Fri Jun 11 12:43:30 WST 2004


On Friday 11 June 2004 12:35, Jay Turner wrote:
> > Notwithstanding that this won't actually tell you that dd is
> > actually doing its thing:
> >
> > 	( while : ; do sleep 3 ; echo -n "." ; done ) &
> > 	dotter=$!
> > 	dd if=/dev/the_ universe of=black_hole bs=1planet
> > 	kill $dotter
> >
> > A "better" way would be to check to see if the output is growing
> > or if it's been updated every few seconds for a special file before
> > producing the dot.
>
> This is very similar to the squid function I posted about.
>
> I believe this will do what I require.
> Could you please explain what "while : ;" and "dotter=$!" are doing.

The shell's ":" is short-hand for "true", so 
	while :
will loop forever, at least until there's a break or exit inside the
loop.

$! is the process ID of the last process put into background.

> I have not encountered them before in my bash experience..

I've only been shell programming since 1983; and I'm still learning
tricks.





More information about the plug mailing list