[clug] how can I know umount command do success!

Stephen Jenkin sjenkin at canb.auug.org.au
Wed Jan 26 04:52:52 GMT 2005


Sorry for wasting bandwidth with a second message...  Bear of Little Brain
today :-(

Answering the subject line 'how can I know umount command succedded?'
Use the '&&' (and) construct - the second command will ONLY be executed if
the first command succeeds...

Try:

#/bin/sh
umount /volume1 && rm -rf /volume1
umount /volume2 && rm -rf /volume2


On Wed, 26 Jan 2005, [gb2312] =C2=E9=D1=A9=F2=D4 wrote:

> hi,
>   now my linux have mount two file system: the 'df' prints following info=
rmation:
> =20
>   Filesystem           1k-blocks      Used Available Use% Mounted on
>   /dev/hda1              5044156    188084   4599840   4% /volume1
>   /dev/hdb1              5044156    188084   4599840   4% /volume2
>=20
>   I write a shell as followed:
>  =20
>   #/bin/sh
>   umount /volume1
>   rm -dfr /volume1
>   umount /volume2
>   rm -dfr /volume2
>=20
>   but when the shell excutes , I often causes error! I think it may be th=
e umount command hasn't
>   finished, then the rm has worked!
>=20
>=20
> --=20
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
>=20


Steve Jenkin, Unix Sys Admin
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

sjenkin at canb.auug.org.au http://www.tip.net.au/~sjenkin




More information about the linux mailing list