Subject: Re: which echo.c would you choose?
To: None <>
From: None <>
List: current-users
Date: 11/30/1999 00:21:12
In message <199911300608.BAA25792@Twig.Rodents.Montreal.QC.CA>, der Mouse write
>- Use strcmp for -n.  Reason: efficiency difference is lost in the
>   noise, so the maintainability advantage takes over.

I'd rather see "use something very similar to getopt", because that's more
canonical, although I don't know what echo is *supposed* to do with "--".

>- Skip all the (void) casts.  This is one of the cases in which I
>   entirely agree with Richard Stallman: there is nothing wrong with
>   ignoring return values, and any tool that thinks otherwise should be
>   ignored or configured into saner behavior.  (As an example of this
>   sort of configuration, I have a wrapper for lint that filters out
>   messages that I have found are almost uniformly useless noise.)

I would support that one.

>If I had to choose among only the four programs presented, I would
>probably pick B, unless handling \c were important, in which case A
>would be the only candidate on simple functionality grounds.

I would say that '\c' is moderately-useful, although not stunningly necessary.
It's a SYSV'ism, but it's a common enough guess for shell scripts that it
might as well be supported.