[ale] Simple shell scripting

Geoffrey esoteric at 3times25.net
Wed Mar 30 17:16:33 EST 2005


Christopher Fowler wrote:
> I am creating a bootable usb stick and I need to somehow cycle through
> the devices until I get a successful mount.  Right now I'm doing it with
> cdrom so I do something like this
> 
> mount -t iso9660 /dev/hdb /cd || mount -t iso9660 /dev/hdc /cd
> 
> What would be good loop that could do this for me?

I'm not exactly sure what you're looking to do, but maybe:


for hd in hda hdb hdc hdd hde hdf hdg; do
	mount -t iso9660 /dev/$hd /cd && break
done

-- 
Until later, Geoffrey



More information about the Ale mailing list