From owner-freebsd-questions Fri Dec 17 1:34:27 1999 Delivered-To: freebsd-questions@freebsd.org Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 803E515088 for ; Fri, 17 Dec 1999 01:34:24 -0800 (PST) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.11 #1) id 11ytm1-0007gI-00; Fri, 17 Dec 1999 11:34:05 +0200 From: Sheldon Hearn To: dl@tyfon.net Cc: "[FreeBSD-Questions-List] (E-post)" Subject: Re: Followup: howto tokenize string in sh In-reply-to: Your message of "Fri, 17 Dec 1999 10:04:55 +0100." <01BF4876.2B909660.dl@tyfon.net> Date: Fri, 17 Dec 1999 11:34:04 +0200 Message-ID: <29529.945423244@axl.noc.iafrica.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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