Date: Thu, 27 Feb 1997 23:06:04 +1030 (CST) From: Michael Smith <msmith@atrad.adelaide.edu.au> To: vince@mail.MCESTATE.COM (Vincent Poy) Cc: chat@freebsd.org Subject: Re: Autocreate script Message-ID: <199702271236.XAA03536@genesis.atrad.adelaide.edu.au> In-Reply-To: <Pine.BSF.3.95.970227025709.438R-100000@mail.MCESTATE.COM> from Vincent Poy at "Feb 27, 97 02:58:11 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Vincent Poy stands accused of saying: > I'm currently working on the autocreate script...looks good so > far. I was wondering if anyone knew of a way to convert strings. > > Let's say $string is "SomeLongUserName" > I want to convert that to "SomeLong" > > so it would be a valid username. > > Any ideas? $ string=SomeLongUserName $ echo "puts [string range $string 0 7]" | tclsh SomeLong or for the minimalists amongst us : $ echo $string | cut -c 1-8 SomeLong (I presume you're using sh here, of course not having told us that you could be accused of wasting our time...) > Vince - vince@MCESTATE.COM - vince@GAIANET.NET ________ __ ____ > Unix Networking Operations - FreeBSD-Real Unix for Free / / / / | / |[__ ] -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702271236.XAA03536>