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



Seriously, try it. History expansion works on input lines separated by the user asking the shell to run them, it can't cross reference command arguments on the same command line.


You are correct, so have an upvote.

&& in OS X seems to put the left side into history and works as I described, but it didn't work when I tried it in Ubuntu 10. $_ works in both.


I have tried both, the difference is only that !$ echos the expanded command, while $_ simply runs the expanded command; both create a directory and cd into it.

(I'm running OS X, FWIW)




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

Search: