using return values in shell scripts
Date: Thu, 30 Sep 2004 00:05:31 GMT
How can I conditionally use the return code of a command ('mount' in this
case) in a shell script?
I want to do something like:
# first, mount the SMB volume
val=`mount -t smbfs -o username=jill,password="" //HAL/C /mnt/hal`
if [ $val -eq 0 ] ; then
echo "Cannot mount //HAL/C on /mnt/hal"
_/ Everything should be made as simple as possible, but not simpler.
_/ -- Albert Einstein
- Re: [kde-linux] Mounting with exec flag
... I have a WD external drive and when I mount it through KDE, ... stuff), how can I tell it to mount this drive with the exec, flag? ... And I can copy a shell script to both devices and then execute ...
- RE: smb share
... I had a problem also mount a smb share until I upgraded to 2.2.8. ... successfully with the following command smbclient ... unsubscribe mailto:email@example.com?subject=unsubscribe ...
- Re: automount usb flash drive?
... attach command on the umass* action. ... >> when I do the following command line command the usb flash drive mount fine ... unless you give it 777 permissions. ... > I found that making a one-line shell script to do the mounting is much ...
- Re: [SLE] User mounting smbfs
... >> I've been trying to configure fstab, to allow a user to mount an smb ... You should put the smb mount in fstab. ... can you mount it on the command line OK? ...
- Re: Mounting external USB disk
... Note that a backup disk should only be mounted when its being accessed - ... The shell script needs to be a bit longer than three lines. ... minimum to check the termination codes output by mount, rsync and umount ...