take multiple lines bash code example
Example 1: read input from multiple lines in BASH
$ myVar=$(</dev/stdin)
hello
this is test
$ echo $myVar
hello this is test
$ echo "$myVar"
hello
this is test
Example 2: read input from multiple lines in BASH
user@host:~$ read -d '' x <<EOF
> mic
> check
> one
> two
> EOF