Difference between revisions of "read multiline user input in bash"

From thelinuxwiki
Jump to: navigation, search
(Created page with "<source lang="bash"> # get input from user via CLI echo "Paste import config..." IFS= read -d '' -n 1 importvariable while IFS= read -d '' -n 1 -t 2 c do importvariable+=...")

Revision as of 00:37, 2 November 2022

# get input from user via CLI
echo "Paste import config..."
IFS= read -d '' -n 1 importvariable
while IFS= read -d '' -n 1 -t 2 c
do
    importvariable+=$c
done