logoalt Hacker News

Dylan16807today at 3:18 AM1 replyview on HN

> At least allow us to use names instead of numbers.

You can use /dev/stdin, /dev/stdout, /dev/stderr in most cases, but it's not perfect.


Replies

murphyslawtoday at 4:38 AM

> You can use /dev/stdin, /dev/stdout, /dev/stderr in most cases

Never ever write code that assumes this. These dev shorthands are Linux specific, and you'll even need a certain minimum Linux version.

I cringe at the amount of shell scripts that assume bash is the system interpreter, and not sh or ksh.

Always assume sh, it's the most portable.

Linux != Unix.

show 4 replies