From owner-freebsd-questions Tue Feb 19 22: 1:27 2002 Delivered-To: freebsd-questions@freebsd.org Received: from web9407.mail.yahoo.com (web9407.mail.yahoo.com [216.136.129.23]) by hub.freebsd.org (Postfix) with SMTP id 5B6B637B437 for <freebsd-questions@FreeBSD.ORG>; Tue, 19 Feb 2002 22:01:04 -0800 (PST) Message-ID: <20020220060104.49523.qmail@web9407.mail.yahoo.com> Received: from [65.94.26.37] by web9407.mail.yahoo.com via HTTP; Tue, 19 Feb 2002 22:01:04 PST Date: Tue, 19 Feb 2002 22:01:04 -0800 (PST) From: Eric Boucher <eric_boucher60@yahoo.com> Subject: Bourne shell programming problem To: FreeBSD <freebsd-questions@FreeBSD.ORG> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: <freebsd-questions.FreeBSD.ORG> List-Archive: <http://docs.freebsd.org/mail/> (Web Archive) List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions) List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-questions> List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-questions> X-Loop: FreeBSD.ORG Hi everyone, I'm doing a little bourne shell program that makes something installed automatically on my FreeBSD. But I have a little problem: I want to be able to read every caracter of a variable. For example: Suppose I have a variale named TOTO and the content of TOTO is "/toto/tata/foo". So if I do an echo the ouput is: echo $TOTO /toto/tata/foo What I'm trying to do is to catch only "/foo" and put it in another variable. So I tought that if someone tell me how to read each caracter, I can loop over each caracter, remember the positition of the last "/" and then take all the caracters after that "/" and put it in a variable. Can somebody help me on this one? I hope I'm sufficiently clear. Thanks Eric __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message