How to read mutliline input from stdin into variable and how to print one out in shell(sh,bash)?
问题 What I want to do is the following: read in multiple line input from stdin into variable A make various operations on A pipe A without losing delimiter symbols ( \n , \r , \t ,etc) to another command The current problem is that, I can't read it in with read command, because it stops reading at newline. I can read stdin with cat , like this: my_var=`cat /dev/stdin` , but then I don't know how to print it. So that the newline, tab, and other delimiters are still there. My sample script looks