This is my main script:
#!/bin/bash
read -p "Name: " NAME
read -p "Age: " AGE
read -p "Country: " COUNTRY
echo "Your name is $NAME. You are $AGE years old. You live in $COUNTRY."
Suppose I have a file (data.txt) with the following format:
Charly
32
Spain
If I pipeline in the following way:
cat data.txt | ./main.sh
The result is obviously correct, but it ocurrs immediately.
It is possible to generate a pause between each read statement simulating the time it takes the user to answer?
As if I could send each value one by one through the pipe and pause, say, for 5 seconds, between each sending.
It is possible to display the information read from the file data.txt one by one (Charly, 32, Spain), the entire word for each iteration or character by character for each string (simulating the info is really typing by hand).
For example:
I would see on the screen at the start of the process
NAME:
and after five seconds
NAME: Charly
AGE:
and so on.


cat data.txt | ./main.shdoes not display the prompts ... is that 'ok' or do you also want the prompts displayed? and while we're at it, are you looking for the inputs (Charly,32,Spain) to be displayed, too (exactly as if being typed in by hand)?echo "Charly" | ./main.sh. Regards.