View Single Post

  #1 (permalink)  
Old 11-17-2006, 12:36 PM
warren warren is offline
Member
User
 
Join Date: Jun 2005
Posts: 45
Rep Power: 0
warren
Default displaying the executed command then echo the status

Hi,

I have a simple question for everyone. I just need only to format a device then mount. heres the sample code:

echo "formatting /dev/$dev ....mkfs.ext3 /dev/$dev"
mkfs.ext3 -Fq /dev/$dev
mount /dev/$dev /mnt/$dev

I would like to modify it that will display a msg after the task is completed. Like:
formatting /dev/sda.............................................[done]

If format fails, then "failed" will be displayed. my problem is how to display this in a single line just like in above.
any ideas are greatly welcome.

thanks,
warren
Reply With Quote