07-04-04 10:52 PM
In article <40e7a018$0$332$4d4ef98e@read.news.ch.uu.net>,
"familie oehler" <oehlers@bluewin.ch> wrote:
> hi
>
> i was programing installation procedures based on bourne-sh, sed, awk and
all
> other nice staff.
>
> but than i run into troubles with the bourne-sh.
>
> i found out the jsh (bourne-sh in solaris) is parsing strings in a rather
> funny way. i contacted sun and the answer was - that's the way bourne sh i
s
> working since ever. i hardly can believe this.
>
> i tried my old 286 with interactive unix (1989) - but it does not work any
> more. the ega monitor is missing. i so try to figure out the behavior of t
he
> real bourne-sh by contacting other unix poeple.
>
> the problem is simple: empty tokens are ignored. no other parsing algoryth
m
> in
> any library or tool like awk, sed ... behave that way. anyone who has
> experience in parsing information knows - it does not make sense because y
our
> loosing orientation.
Remember, the word parsing algorithm is primarily intended for parsing
command lines, which use whitespace as the delimiter. If you typed:
cat foo bar
would you really expect it to operate differently from
cat foo bar
? Do you expect it to look for a file named "" because there's an
"empty token" between the two spaces?
If you want a tool that doesn't treat a sequence of delimiters as a
single delimiter, try "cut".
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
[ Post a follow-up to this message ]
|