Skip to content

heredoc to feed an interactive program

Let this be the interactive program:

read input1
read input2
echo $input1 $input2

This is a script (in the same directoty) that uses heredoc to feed two lines to

./ << EOF

It work as:

$ ./
asdf zxcv
Published inenglish

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *