In the last episode (Aug 17), jdyke said:
> Jorge Mario G. Mazo wrote:
> >hi there
> >I've been looking for a way to check the fs type
> >I need to do something like this
> >
> >if NTFS do this
> >if msdis do that
> >if ufs2  do that
> >if ext2 do this other stuff
> 
> not sure if this is what your looking for, but there are likely a million 
> ways, one being
> 
> in bash

any bourne shell, actually.
 
> $ fs_to_check=/dev/ad4s1g
> $ fstype=`grep $fs_to_check /etc/fstab | awk '{ print $3 }'`
> $ echo $fstype
> ufs

Might be better to use the output of "mount -p" instead of /etc/fstab,
since the filesystem may have been automounted or otherwise not in
fstab.  Unfortunately, mount -p doesn't take an argument to limit the
output to just the filessytem listed..


-- 
        Dan Nelson
        [EMAIL PROTECTED]
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to