From owner-freebsd-questions Fri Dec 17 1: 4: 2 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cronus.medianetwork.se (cronus.medianetwork.se [193.14.204.1]) by hub.freebsd.org (Postfix) with ESMTP id A9DBD15088 for ; Fri, 17 Dec 1999 01:03:59 -0800 (PST) (envelope-from dl@tyfon.net) Received: from junglenote.com (digital02.medianetwork.se [193.14.204.220]) by cronus.medianetwork.se (8.9.3/8.7) with ESMTP id KAA23408 for ; Fri, 17 Dec 1999 10:03:58 +0100 Received: from enigmatic [127.0.0.1] by junglenote.com [localhost] with SMTP (MDaemon.v2.84.R) for ; Fri, 17 Dec 1999 10:15:02 +0100 Received: by localhost with Microsoft MAPI; Fri, 17 Dec 1999 10:04:56 +0100 Message-ID: <01BF4876.2B909660.dl@tyfon.net> From: Dan Larsson To: "[FreeBSD-Questions-List] (E-post)" Subject: Followup: howto tokenize string in sh Date: Fri, 17 Dec 1999 10:04:55 +0100 Organization: Tyfon Internet Services [ http://tyfon.net ] X-Mailer: Microsoft Internet-e-post/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-MDaemon-Deliver-To: freebsd-questions@freebsd.org X-Return-Path: dl@tyfon.net Reply-To: dl@tyfon.net Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I know a echo "path../../is/relative" | awk -F/ '{print $n}' prints one token but I don't know how to evaluate all with ".." and return true if ".." is found in a token. Regards ------------ Dan Larsson Having a string containing a path, what I need to do with it is to determine if it is relative to current or not. 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. How do I do this in sh? Regards ------------ Dan Larsson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message