Hello,
Problem Description:
i have a directory with a set of files and these files name saved in table into database called "File_names" i want to make shell script that loop on the directory and each time search if that file name exist in the database or not ,then if no : insert that name into database . else do nothing.
My trail:
FILES=/path/*
for f in $FILES
do
echo $f
done
But $f here contains the path + name i want to be the name only to do smthing like:
count = " select count(*) from File_names where name = $f"
How can i do this ?
Thanks in Advance