[ale] I am an idiot
Chris Fowler
ChrisF at computone.com
Tue Jun 26 17:12:17 EDT 2001
#!/bin/ksh
#
STRING="hello|goodbye"
VAR1=`echo $STRING | cut -d'\|' -f1`
VAR2=`echo $STRING | cut -d'\|' -f2`
#END
-----Original Message-----
From: Jason Lynn [mailto:jason_lynn_ at hotmail.com]
To: ale at ale.org
Sent: Tuesday, June 26, 2001 5:03 PM
To: ale at ale.org
Subject: [ale] I am an idiot
Now that that's out of the way... here's my problem.
#!/bin/ksh
#
echo AARGH!
exit 0
I need some way to do some basic string manipulation that works both for
Linux and Solaris (out of the box). I basically need to take a string like
"hello|goodbye" and split that string into two components, hello and goodbye
(assign them to shell variables, etc.) by a delimeter such as '|'. I
thought everything was going well when I used expr to do just that. No
problems in Linux. It appears, though, that functions like substr, length,
etc are NOT supported in sparc Solaris. So I looked into awk and sed (for
the first time), which only served to piss me off even more. Can anyone
help me with this one?
Thanks in advance,
Jason
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list