I want to tokenise a string using shell delimiters...
|, >, <, >>, <<
I can do that fine, except when the string is like:
command1>command2
(i.e - no spaces between commands and tokens)
Any ideas?
Printable View
I want to tokenise a string using shell delimiters...
|, >, <, >>, <<
I can do that fine, except when the string is like:
command1>command2
(i.e - no spaces between commands and tokens)
Any ideas?
Just do what you would do to split the string normally, except when you find a delimeter, split at that point, but make the next token equal the delimeter.
Z.Code:command1>command2
tokenizes to
command1
>
command2
You're a thinker. ;)
Cheers,
RJ
It becomes a pain in the arse to need to tokenize a string, but need to preserve sections of the string that contain delimeters =).
Z.
Most of the relevant function is done for me, just gotta modify. My brain is fried this last few weeks. Had too much on, and I've fizzled out... :p