1

I have a script that reads few inputs and waits for user to press ENTER key to continue. Once it continues it again asks for user inputs. Is there a way I can automate the user inputs? I mean by giving the inputs in a file?

I tried redirecting from input file. The "enter key" is causing some confusions. I have gone through the other threads and doesn't help me.

SCRIPT /*******

#!/bin/bash
read inputOne
read inputTwo
echo $inputOne
echo $inputTwo
echo "-------------------------"
echo "Press ENTER"
echo "Continue ....."
read inputThree
echo $inputThree

*******/

INPUT FILE

inputOne
inputTwo
inputThree

USAGE

$script.sh < inputfile.txt 

I am not seeing the 3rd echo getting printed.

Seema Kadavan
  • 2,538
  • 1
  • 16
  • 31

0 Answers0