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

I'm not sure if this is POSIX, but if you program accepts positional arguments, in bash you can do eg.: diff <(somecommand) <(someothercommand) and the shell will replace these with /dev/fd/<n>, allowing you to also accept standard input without relying on hardcoded file descriptors.


Cool tip. You're right though, bash in /bin/sh mode doesn't have that feature.




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

Search: