From owner-freebsd-chat Thu Feb 27 05:59:18 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA27572 for chat-outgoing; Thu, 27 Feb 1997 05:59:18 -0800 (PST) Received: from mail.MCESTATE.COM (vince@mail.MCESTATE.COM [206.171.98.50]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA27567 for ; Thu, 27 Feb 1997 05:59:16 -0800 (PST) Received: from localhost (vince@localhost) by mail.MCESTATE.COM (8.8.5/8.8.5) with SMTP id FAA06738; Thu, 27 Feb 1997 05:59:05 -0800 (PST) Date: Thu, 27 Feb 1997 05:59:04 -0800 (PST) From: Vincent Poy To: Michael Smith cc: chat@freebsd.org Subject: Re: Autocreate script In-Reply-To: <199702271236.XAA03536@genesis.atrad.adelaide.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-chat@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 27 Feb 1997, Michael Smith wrote: > 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 Thanks! OK...how would I get that result into another variable like $string2 ? Cheers, Vince - vince@MCESTATE.COM - vince@GAIANET.NET ________ __ ____ Unix Networking Operations - FreeBSD-Real Unix for Free / / / / | / |[__ ] GaiaNet Corporation - M & C Estate / / / / | / | __] ] Beverly Hills, California USA 90210 / / / / / |/ / | __] ] HongKong Stars/Gravis UltraSound Mailing Lists Admin /_/_/_/_/|___/|_|[____]