read multiline user input in bash

From thelinuxwiki
Revision as of 00:37, 2 November 2022 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
# 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