On Monday, 8 July 2013 at 09:08:18 UTC, Leandro Lucarella wrote:
John Colvin, el  7 de July a las 22:39 me escribiste:
On Sunday, 7 July 2013 at 20:08:19 UTC, Leandro Lucarella wrote:
>Andrei Alexandrescu, el  7 de July a las 09:06 me escribiste:
>>On 7/7/13 8:55 AM, Andrei Alexandrescu wrote:
>>>Here's a conformant implementation for reference:
>>>http://www.scs.stanford.edu/histar/src/pkg/echo/echo.c
>>
>>Hmm, that's actually not so good, it doesn't ensure that I/O >>was
>>successful. Anyhow, here's a possibility:
>>
>>import std.stdout;
>>void main(string[] args)
>>{
>>    const appendNewline = args.length > 1 && args[1] == "-n";
>>    foreach (i, arg; args[appendNewline + 1 .. $])
>>    {
>>        if (i) write(' ');
>>        write(arg);
>>    }
>>    if (nl) writeln();
>>}
>>
>>But then I figured echo must do escape character processing, >>see >>e.g. >>http://www.raspberryginger.com/jbailey/minix/html/echo_8c-source.html.
>>With that the blog entry would become quite interesting.
>
>If you want the specification, here it is :)
>http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html

I prefer this one :p http://www.gnu.org/fun/jokes/echo-msg.html

From the opengroup spec:
"If the first operand is -n, or if any of the operands contain a
<backslash> character, the results are implementation-defined."

Ah...specifications...


I'm gonna stick with normal linux implementation, as described here:
http://linux.die.net/man/1/echo

That's not Linux, that's GNU coreutils :)

Sue me :p Strangely, it's in direct contradiction with the GNU coreutils documentation, as hosted on the GNU site.

Reply via email to