Live data from Hacker News

Echo – Assembly program that prints the first positional argument to stdout

github.com

1–10 of 50 posts

Re: Echo – Assembly program that prints the first positional argument to stdout

#8

echo returns nonzero if it cannot write ... touch foo.txt; chmod 400 foo.txt; echo ouch > foo.txt; echo $? .., but it appears this asm returns zero always.

How do "raw" system calls pass back error information on Linux? errno is strictly a C/POSIX abstraction, right?

Re: Echo – Assembly program that prints the first positional argument to stdout

#10
post #5

Serious question: why is this on HN front page? Am I missing something?

I feel it's kind of interesting as a minimal Unix program that does something useful without linking to the C library, just with syscalls.

Even for echo, this one is extremely minimalist: first argument only, and a maximum of 255 characters.

Post reply on HN