Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by serverfault.com #
 
PREVIOUS NEXT
Tagged: #read #input #multiple #lines #BASH
ADD COMMENT
Topic
Name
9+1 =