Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to copy multiple lines (splitted by Enter key) from, for example, notepad and then paste it into new variable in CMD or Bash console and after that do some operations on it.

Although it's quite easy in PowerShell (I simply type


then paste copied lines and simply add


at the end) in predecessor it's much more complicated since CMD interpret each enter as "execute". Is there any other way to accomplish it, instead of save as external text file?

share|improve this question
cmd and bash are fundamentally different might be better to split the question, because I'd bet for bash it's enough to escape (with a backslash) the linebreaks. – Bobby Jun 5 '12 at 9:04
Bash console should work the same way as PowerShell. I'd just use ' instead of " to avoid expansion. – choroba Jun 5 '12 at 9:20

Postfix each line with a \ to indicate multiple lines. Answered on Stack Overflow (although it probably doesn't even belong there.)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .