Hacker News new | past | comments | ask | show | jobs | submit login

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)

Yeah, but this and this do different things:

  # prints a newline
  echo $(echo "-e a\nb")

  # prints "-e a\nb"
  echo "$(echo "-e a\nb")"

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact