🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1717

Re: finding the filesystem of a file

#1717
From: Conor P. Cahill
Date: Tue, 06 Nov 1990 02:10
28 lines
1321 bytes
In article <6495@emory.mathcs.emory.edu> dt@mathcs.emory.edu (Dave Taylor {guest}) writes:
>Curious to know if anyone can tell me the fastest way to find out which
>filesystem a given file is on if the entire pathname is given.  I have only

Maybe not the fastest, but it will work:

lookup=path_to_look_up
len=0
filesys=`(mount; echo done) | while read fs junk
do
	if [ "x$fs" = "xdone" ]; then
		echo $lfs
	fi
	tlen=\`expr "x$lookup" : "x$fs"\`
	if [ "$tlen" -gt "$len" ]; then
		lfs="$fs"
		len="$tlen"
	fi

done`

echo "$filesys"


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 
Technical Details
Message-ID: <1990Nov06.021023.11941@virtech.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!wuarchive!cs.utexas.edu!uunet!virtech!cpcahil
References: <6495@emory.mathcs.emory.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!wuarchive!cs.utexas.edu!uunet!virtech!cpcahil
From: cpcahil@virtech.uucp (Conor P. Cahill)
Newsgroups: comp.unix.shell
Subject: Re: finding the filesystem of a file
Keywords: filesystem search find file
Message-ID: <1990Nov06.021023.11941@virtech.uucp>
Date: 6 Nov 90 02:10:23 GMT
References: <6495@emory.mathcs.emory.edu>
Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill)
Distribution: usa
Organization: Virtual Technologies Inc., Sterling VA
Lines: 28