Very true, that will work.
But, my example was a simple one I provided in order to learn how to do the much more complex ones I need.
Thanks for the reply however.
Gee whiz, that's exactly like Perl. I spent an hour googling on docs and never once found such a simple, clear (and sufficiently complex) example.
Thanks Feherke!
Thanks, Sam. Yes, of course you're right. I've used sed and awk for years and they will do the job. I'm trying to learn how this is done in native ksh93 though. All those calls to external programs adds a lot of process overhead if you do enough of them.
So, if anyone knows hows to do this...
In ksh93, I want to match on a string and be able to print out the subpatterns like I do in perl.
Given the following:
line="abc (hij) = lmn"
if [[ $line = @(*[a-z]\(*[a-z]\)=*[a-z]) ]]; then
v1=${.sh.match[1]}
v2=${.sh.match[2]}
v3=${.sh.match[3]}
print...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.