I'm very new to bash scripting and here's what i'm trying to do:
1 - Read a file - this file is a list of names 2 - Ask user if they want to delete {name} 3 - If user enters y, proceed
This is what my script looks so far:
while IFS= read -r repo
do
read -p "Do you want to delete $repo" ip
echo $ip
if [ "$ip" == "y" ]
then
#do something
fi
done < "$filename"
The read -p
line does not wait for a user prompt. I sort of understood what/where the problem is and I was trying to resolve it by reading up on this link - https://bash.cyberciti.biz/guide/Reads_from_the_file_descriptor_(fd)
But somehow I was unable to resolve this issue. What am I doing wrong? Please help!