[Wylug-help] Shell scripting

Thomas, Nicholas nick.thomas at eldon.co.uk
Mon May 10 09:24:31 BST 2004


I have used:

foo = `echo $bar | cut -c-32`

> -----Original Message-----
> From: Alan J.Wylie [mailto:jlyht at wylie.me.uk]
> Sent: 10 May 2004 07:24
> To: Nick Jeffery
> Cc: wylug-help at wylug.org.uk
> Subject: Re: [Wylug-help] Shell scripting
>
>
> On Sun, 09 May 2004 22:23:34 +0100, Nick Jeffery <stash at o2.ie> said:
>
> > Hullo, I've a variable (from cat'ing a file) in a bash
> shell script.
> > I'd like to get only the first 32 characters of the
> file/variable on
> > their own..
>
> > I've tried:
>
> > foo=`echo ${bar:32}` but that doesn't seem to want to play ball.
>
> foo=`echo ${bar:0:32}`
>
> --
> Alan J. Wylie
> http://www.wylie.me.uk/
> "Perfection [in design] is achieved
> not when there is nothing left to add, but rather when there
> is nothing left to take away."
>   -- Antoine de Saint-Exupery
>
> _______________________________________________
> Wylug-help mailing list
> Wylug-help at wylug.org.uk
> http://list.wylug.org.uk/mailman/listinfo/wylu> g-help
>




More information about the Wylug-help mailing list