[plug] Bash "Processing" Script

Garry garbuck at westnet.com.au
Fri Jun 11 12:27:14 WST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jay Turner wrote:
| 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.

Here's an idea as far as stucture goes..No doubt the syntax is wrong
though. I've not done bash stuff, but it IS one of Those Things I've
meant to do..

How about...

Put your dd into a script, eg "copystuff".

While(copystuff) do
	{
	print "."
	wait(15)
	}

Hope this helps.

Garry


- --




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAyTSivdH9DANniC8RAltYAKDKG/v0yBJBqD8cKIh6v71LO7tG8wCg1ct/
pt0VGevKdXekym14c7ig2BU=
=8I00
-----END PGP SIGNATURE-----



More information about the plug mailing list