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

Is this for an in-person interview?

Because without checking `man` or stackoverflow (or leaning on ChatGTP) my first response would be to go with `if [ $# -lt 1 ]; ...`. This has the advantage of being pretty readable, and while I've been doing shell scripting for long enough to consider myself reasonably competent at it, I'd have to refer to the man page to be sure what `${1:?}` did.



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

Search: