Title : Redirect stdin into a variable in shell Author: Solène Date : 12 September 2016 Tags : shell unix If you want to write a script reading stdin and put it into a variable, there is an very easy way to procede : #!/bin/sh var=`cat` echo $var That's all