Mail Archives: cygwin/1999/07/14/12:21:34
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 AT pixstream DOT com Waterloo, ON
(519) 884-4196 X2286 N2L 3L3
(519) 884-5949 (FAX) http://www.pixstream.com
-----Original Message-----
From: fladerr AT dk DOT ibm DOT com [mailto:fladerr AT dk DOT ibm DOT com]
Sent: Wednesday, July 14, 1999 9:21 AM
To: cygwin AT sourceware DOT cygnus DOT 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 AT dk DOT ibm DOT com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -