<quote who="Tony Green">

> > > How do I tell in perl-speak (ie without rewriting the whole thing in
> > > Java) that the mount point succeeded. 
> > 
> > How about grepping the output of 'mount' for the mountpoint? That's how I'd
> > do it in bash. :-)
> 
> You can use the return codes - just like $? in shell programming.
> 
> Example :
> if ( system("mount -t smbfs remoteserver:/mntpoint /mnt 2>/dev/null
> 1>/dev/null"))

Tony and I bantered about this on IRC. Checking the return code is always a
good idea, but I would personally check the output of mount too, as the
error code might not indicate that you don't have a valid mount (already
mount, etc.).

But yes, *always* check error codes in your scripts... Saves face later. ;)

- Jeff

-- 
                "What inspired you to become a bus driver?"                 
                             "Linus Torvalds."                              
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to