I am trying to create my first bash script:
echo "What file are we looking for: "
read FILE
while [ 1 ]
do
ls -lah | grep $FILE
sleep 1;
clear
# Some way to detect user input
if [ user-input ]
then
echo "Input found"
exit 1;
fi
done
Is there a way to look for user input without pausing the program? When I used read input before the if statement, the program stopped until input was...inputted.... The program is supposed to continuously output the file I am look using ls and clear so I can monitor the size as it grows, but when the user inputs any key stroke the program exits.
Like I said this is my first bash script, I do know python pretty well and understand 'coding' but not bash.
Thanks