[Wylug-help] Shell scripting
Gary Stainburn
gary.stainburn at ringways.co.uk
Mon May 10 09:20:57 BST 2004
On Sunday 09 May 2004 10:23 pm, Nick Jeffery wrote:
> 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.
>
> Anyone got an idea? Don't want to use regexps/perl/awk if at all possible.
>
> Cheers,
> nsj.
foo=`echo $bar|cut -c1-32`
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
More information about the Wylug-help
mailing list