Afficher un message
Vieux 23/08/2006, 18h59   #16
Michal Nazarewicz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Access 1st 12 charectors of a word.

Dave Kelly <daveekelly@earthlink.net> writes:

> I need only the first 12 character of the 3 word. This word is not
> guaranteed to be 12 character long. This is where I'm stuck.


That's pretty ugly but works on ny POSIX shell and does not require
external aplications (thus fork + exec):

while [ $#WORD -gt 12 ]; do WORD="${WORD%?}"; done

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
  Réponse avec citation
 
Page generated in 0,05976 seconds with 9 queries