Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's also "moreutils"[1] which is a set of useful additional tools. "errno" is indispensable if you're a Linux programmer.

[1] https://joeyh.name/code/moreutils/



I use sponge from moreutils all the time. You know how you always want to ‘sort <file >file’ or something but that doesn’t work because file gets truncated before it gets read? With sponge you can do ‘sort <file | sponge file’


That's pretty neat! But I feel some of those tools can just be implemented with coreutils, pipes, and redirects...


While not as fancy as errno(1),

    perl -e '$! = shift and print "$!\n"' ERRNO
works to decode (nonzero) ERRNO if Perl is installed (per strerror(3) in the C runtime library linked to Perl, so YMMV on non-POSIXish platforms).

Speaking of portability, Microsoft's err.exe[1] is a conceptually similar tool that references a considerably larger collection of Windows error messages (user and kernel mode Win32 error codes, COM HRESULTs, etc) and is therefore far more useful on Windows platforms than anything naïvely implemented in terms of C runtime errno (e.g., my stupid Perl one-liner).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: