Path: utzoo!attcan!uunet!mcsun!hp4nl!ctisbv!pim From: pim@cti-software.nl (Pim Zandbergen) Newsgroups: comp.unix.shell Subject: Re: Getting at the first char of a string in Bourne shell Message-ID: <1990Sep29.215559.25098@cti-software.nl> Date: 29 Sep 90 21:55:59 GMT References: <1308@ncrwat.Waterloo.NCR.COM> <9737@jpl-devvax.JPL.NASA.GOV> <1990Sep29.193617.25752@iwarp.intel.com> Organization: CTI Software BV, The Hague, The Netherlands Lines: 15 How about string=`echo $string | cut -c1` I don't think the Bourne shell can do this without executing an external command. In Korn shell you can use a hack like string=${string%${string#?}} -- Pim Zandbergen domain : pim@cti-software.nl CTI Software BV uucp : uunet!mcsun!hp4nl!ctisbv!pim Laan Copes van Cattenburch 70 phone : +31 70 3542302 2585 GD The Hague, The Netherlands fax : +31 70 3512837