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
|