4 ms·
That's technically incorrect. !$ is a shortcut for !!:$, which is the last word of the previous command in history. A filename is treated as a single word, as y
by sethrin 9y ago
That's technically incorrect. !$ is a shortcut for !!:$, which is the last word of the previous command in history. A filename is treated as a single word, as you say. This is however distinct from the last argument, which is accessible with $_ . As an example:
$ echo 'example' > file.txt
Here !$ would return the filename, and $_ would return 'example', which was the last argument to echo.
- lozf 9y agowow ok, neat... gonna have to spend some time with your book, Thanks!