Is there a way to expand the !$ in command line while interactively editing the command inside shell?
For example, while I am typing ls !$, I press some button and then I see what is the value of !$.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you want this sequence to be treated literally, without any expansion? You may quote it with apostrophes:
'!$'UPDATE If you want to expand it before executing, you may use Ctrl-Alt-E, but beware that it would perform “word expansion” as well, so
!$ "single argument"would be expanded toexpanded_string single argument(no quotes => two arguments).You may also use Alt-_ (works in both emacs and vi modes), or Alt-. (works only in emacs mode) to just insert the last argument of the previous command directly, without any expansion.