[plug] Bash "Processing" Script

Jay Turner jturner at bsis.com.au
Fri Jun 11 12:02:37 WST 2004


Hi All,

I have written a bash script that I can use to image partitions from one
disk to another using 'dd'.

As this process can take a while and 'dd' doesn't offer any processing
information, I was hoping to
output a '.' to the screen every x seconds while 'dd' does it's thing.
ie

Imaging............

With a new dot appearing after x seconds.

Does anyone have any ideas on the best way to do this?

Outputting the dots is simple, I just can't work out a way to be able to
start a process (dd) and then keep outputting dots until dd returns an exit
code (hopefully 0, but 1 also needs to be accounted for)..

I wrote a script that appeared to be able to do all that however when I
called 'dd' (actually 'sleep 15' for testing)
the script would wait until 'sleep 15' finished before processing the rest
of the script which contained the dot printing portion.

Hope I have been clear enough in my requirements.

Regards
Jay

PS I'm not really looking for Perl/Python/Fortran solutions, but feel free
to kick them around amongst yourselves :-)





More information about the plug mailing list