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

No, I'm not looking to fork and exec a second program, and short of busybox most shells don't have basename built in.

Common idiom, works in POSIX /bin/sh, bash, dash, ash, and every other sh I've encountered. I make a point of avoiding bashisms in /bin/sh scripts, but I have no problem counting on POSIX sh. :)



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: