How to read mutliline input from stdin into variable and how to print one out in shell(sh,bash)? February 10, 2023 by Tarik This is working for me: myvar=`cat` echo "$myvar" The quotes around $myvar are important.