3 ms·
Fairly sure I meant !$ :) http://www.gnu.org/software/bash/manual/bashref.html#Word-Designators http://www.gnu.org/software/bash/manual/bashref.html#Word-De...
by earnubs 14y ago
Fairly sure I meant !$ :)
http://www.gnu.org/software/bash/manual/bashref.html#Word-Designators http://www.gnu.org/software/bash/manual/bashref.html#Word-De...
- obtu 14y agoSeriously, 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)