Subject: RE: substrings in BASH-shells
From: Mike Kuhl <[email-masked]>
To: "[email-masked]'" <[email-masked]>
Cc: [email-masked]
Date: Wed, 14 Jul 1999 12:04:10 -0400

A snippet from the man page for bash:

       ${parameter:offset:length}
              Substring Expansion.  Expands to up to length char-
              acters of parameter, starting at offset.  If length
              is omitted, expands to the substring of  parameter,
              starting  at  the  character  specified  by offset.
              length and offset are arithmetic  expressions  (see
              ARITHMETIC EVALUATION below).  length must evaluate
              to a number greater than or equal to zero.  If off-
              set evaluates to a number less than zero, the value
              is used as an offset from the end of the  value  of
              parameter.  If parameter is @, the result is length
              positional  parameters  beginning  at  offset.   If
              parameter  is  an array name indexed by @ or *, the
              result is the length members of the array beginning
              with  ${parameter[offset]}.   Substring indexing is
              zero-based unless  the  positional  parameters  are
              used, in which case the indexing starts at 1.

I hope this helps.

Regards,

Mike.

---
Michael Kuhl          PixStream Incorporated
Sr. Test Designer     180 Columbia Street West
[email-masked]   Waterloo, ON
(519) 884-4196 X2286  N2L 3L3
(519) 884-5949 (FAX)  http://www.pixstream.com

-----Original Message-----
From: [email-masked] [mailto:[email-masked]]
Sent: Wednesday, July 14, 1999 9:21 AM
To: [email-masked]
Subject: substrings in BASH-shells

Hi !

How do I get a substring in BASH-shell. I've tried to use the utilities
"awk" and ${string,start,length}, but without luck !

Can you help me ?

Thanks in advance !

Med venlig hilsen/Best regards
Rune Flader

I/T Specialist, Business Solution Integration
IBM Denmark A/S, Sortemosevej 21, DK-3450 Allerød, Denmark
Phone +45 4523 9078,  Mobile +45 2346 6730,  Fax +45 4523 6809
Internet: [email-masked]

--
Want to unsubscribe from this list?
Send a message to [email-masked]

--
Want to unsubscribe from this list?
Send a message to [email-masked]