3 ms·
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
by obtu 14y ago
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.
- earnubs 14y agoYou 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.
- earnubs 14y agoI 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)