Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Dec 1999 11:34:04 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        dl@tyfon.net
Cc:        "[FreeBSD-Questions-List] (E-post)" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Followup: howto tokenize string in sh 
Message-ID:  <29529.945423244@axl.noc.iafrica.com>
In-Reply-To: Your message of "Fri, 17 Dec 1999 10:04:55 %2B0100." <01BF4876.2B909660.dl@tyfon.net> 

next in thread | previous in thread | raw e-mail | index | archive | help


On Fri, 17 Dec 1999 10:04:55 +0100, Dan Larsson wrote:

> Having a string containing a path, what I need to do with it is to 
> determine if it is relative to current or not. 

There's no easy way to do this without using the realpath(3) library
function, to which the shell does not provide an interface.

> For this I imagine that splitting the path with the slashes as delimiters
> to examine the tokens in between for a token containing two dots (..) is
> one way of doing it.  

The fact that a path contains dots does not mean that the path is a
subdirectory of the current working directory.

Ciao,
Sheldon.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?29529.945423244>