Link to home
Start Free TrialLog in
Avatar of Just_RC
Just_RCFlag for United States of America

asked on

String substring?

Everyone:
Good afternoon.  If I wanted the first 4 characters of a string wouldn't I just:

#!/usr/bin/ksh
string=ABCDEJGHIJ
snip=${string:0:4}
echo $snip

I can't seem to make the snip variable contain what I want.  The only progress (see "Knowledge level on this subject :) ) I've been able to make is to set the Start parameter to a negative number which retruns the whole string.

As always many thanks for the help and encouragement.

RC
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Just_RC

ASKER

Yes...indeed it works in bash.  I"m using M-11/16/88i.  Is there some sort of manual for this version, or any way to see how to do it in this envrionment?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Just_RC

ASKER

Thanks everyone...guess I'll skip it (even if its in the book (Rosenblatt & Robbins)