[ale] Simple shell scripting

Jim Popovitch jimpop at yahoo.com
Wed Mar 30 17:00:28 EST 2005


Try this:

-------------------------
#!/bin/sh

for D in b c d e f g; do
   if mount -t iso9660 /dev/hd$D /cd; then
     break;
   fi
done
-------------------------

-Jim P. 

On Wed, 2005-03-30 at 16:34 -0500, 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?
> 
> 
> 
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list