How to write this script?

Ilmo Cruz Leão icleao at hotmail.com
Tue Apr 12 15:20:48 UTC 2005


Hi, Hongwei Li

#first mount
mount sever2:/opt /mnt

#filter the output of 'mount' and put it in control file. I think that it's 
ok to use the comando mount
mount | sed -n /server2/p > /tmp/control

#If there is something in '/tmp/control', do what you want
if [  -s /tmp/control ]; then
         echo "Here do something"
fi
done



ICL



>From: "Hongwei Li" <hongwei at wustl.edu>
>Reply-To: For users of Fedora Core releases <fedora-list at redhat.com>
>To: fedora-list at redhat.com
>Subject: How to write this script?
>Date: Tue, 12 Apr 2005 09:20:10 -0500 (CDT)
>
>Hi,
>
>I have a basic question about a script.  In this script, I want to mount a
>network drive, if successful, then do somethings, otherwise, exit.  My
>script is like this:
>
>#!/bin/csh
>if ( `mount sever2:/opt /mnt` ) then
>  ....
>  umount /mnt
>endif
>
>When I run this script, it does mount the network drive (server2 has done
>all nfs, exportfs etc.), but did not do anything inside the if-endif, and
>did not umount it.  How should I write this script?
>
>Thanks!
>
>Hongwei Li
>
>--
>fedora-list mailing list
>fedora-list at redhat.com
>To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list

_________________________________________________________________
MSN Messenger: converse online com seus amigos .  
http://messenger.msn.com.br




More information about the users mailing list