This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: substrings in BASH-shells
- To: "'fladerr@dk.ibm.com'" <fladerr@dk.ibm.com>
- Subject: RE: substrings in BASH-shells
- From: Mike Kuhl <mkuhl@pixstream.com>
- Date: Wed, 14 Jul 1999 12:04:10 -0400
- Cc: cygwin@sourceware.cygnus.com
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
mkuhl@pixstream.com Waterloo, ON
(519) 884-4196 X2286 N2L 3L3
(519) 884-5949 (FAX) http://www.pixstream.com
-----Original Message-----
From: fladerr@dk.ibm.com [mailto:fladerr@dk.ibm.com]
Sent: Wednesday, July 14, 1999 9:21 AM
To: cygwin@sourceware.cygnus.com
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: fladerr@dk.ibm.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com