read multiline user input in bash

From thelinuxwiki
Jump to: navigation, search
# get input from user via CLI
echo "Paste input..."
IFS= read -d '' -n 1 inputvariable
while IFS= read -d '' -n 1 -t 2 c
do
    inputtvariable+=$c
done