waits for your input each time. Is that what you need ? Or do you need a script which will check your file contents against the directory listing and then carry out your requirement.
just wandering, is there a way to delete the line out of "file.txt" without having to redirect it to a "new_file.txt" , or do we have flush "file.txt" and copy "new_file.txt" into it?
Hi all,
I changed my script to the below, and it works now......
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#!/bin/bash
while read line
do
if [[ -r $line ]]; then
/bin/echo "g/$line/d\nwq!" | ex -s "${1}"
else
echo "file not readable"
fi
done < "${1}"
***script provided by vgersh99.
***Special thanks to vgersh99!!!!!!!!!!!