Re: Weirdest shell behavior ever...



On 2010-09-01, Ed Morton <mortonspam@xxxxxxxxx> wrote:
Beats me. Stating the obvious, though - this should have been written
almost entirely in awk or similar rather than shell in the first
place. The shell is an environment to call tools from, not a language
to program in. For simple text processing as you're doing in that
script, just use a text processing tool like awk.

Historical quirk; the usage environment allows my choice of any language,
as long as it's C, perl, or sh. There was some reason when I started for
which I picked sh. I do plan to rewrite that entirely, it ended up
being a lot more complicated than we originally thought it would be... I
didn't want to impose an additional requirement if I didn't have to (and
yes, I do see systems without perl once in a blue moon), and C is not really
my first choice for string manipulation, though in this case, maybe it should
have been.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@xxxxxxxxx
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
.



Relevant Pages

  • Re: awk language parsing error - closing function parenthesis
    ... I don't think comparisons to shell syntax are relevant. ... AWK is its ... own language with its own syntax. ...
    (comp.lang.awk)
  • Re: Weirdest shell behavior ever...
    ... The shell is an environment to call tools from, ... just use a text processing tool like awk. ... the usage environment allows my choice of any language, ...
    (comp.unix.shell)
  • Re: awk instead of shell?
    ... I like shell for its ability to directly interact with the filesystem via the tools cp, cd, rm, mv, etc. ... However, shell can be very slow (and awk, on the contrary, seems very fast to me) and also, shell misses some idioms, like associative arrays. ... shell is an environment for calling tools. ... Use shell to sequence and provide an environment for the calls to those tools. ...
    (comp.lang.awk)
  • Re: A Different Shell Philosophy
    ... A shell without programming capabilities would be like the ... environment) and doesn't need to be discussed in much detail. ... language and what features can be considered as "being too close ...
    (comp.unix.shell)
  • Re: xargs - is it possible to take each argument in to xargs and use in sed against a file?
    ... You need to have the shell pass the variable to awk. ... A good way to do this is making the variable an environment ... present in the variable (and those special characters are often ...
    (comp.unix.shell)