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

The utility of $_ is often voided by tab-completion in the subsequent command, at least in bash. You won't know what it contains, which makes it dangerous, unless you first check it in a way that also carries it forwards:

printf %s\\n "$_"



Even without tab completion, the variable can hold unexpected values due to user error (you don't see the command as a whole), multiple shell windows, or forgotten context.

Relying on it even in limited scenarios can train an invisible habit that would backfire at the least expected moment.

Any assistance intended for immediate action should itself be immediate, not indirect.




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: