3 ms·
The macro means: \C-a: beginning of line $: self-insert (: self-insert \C-e: end of line ): self-insert So if your prompt (with | for cursor) looks
by dan-robertson 7y ago
The macro means:
\C-a: beginning of line
$: self-insert
(: self-insert
\C-e: end of line
): self-insert
So if your prompt (with | for cursor) looks like this:
grep 'blah blah' |some_file
And you execute that macro, you get:
$(grep 'blah blah' some_file)|
Which is correctly quoted and I think always correctly quotes whatever is at the prompt (unless you e.g. get half way through a string and press enter so the beginning of the prompt is halfway through a string, or maybe if you have multiple lines)
- westurner 7y agoYeah, but this and this do different things: # prints a newline echo $(echo "-e a\nb") # prints "-e a\nb" echo "$(echo "-e a\nb")"