I am a newbie to shell scripting. I need a help on creating a for loop script (shell script) for removing files. I have a table called a_table with column name fil_name which contains all the files that need to be removed.
do you have already an sql-query which gets you the files you want to delete? If yes please show the query if possible as a command like it is run directly from the shell. That will be a good starting point to help you.
I don't know how that looks like with oracle. Here is a statement with MySQL:
echo "SELECT name,phone,mail FROM address;" | mysql DB_NAME
Ideally check the documentation for your oracle-command-line client to leave out any headers, footers and produce output in easy parsable format. This is not required, but makes it easier for you, so you do not have to bother filtering all the superfluous junk out.
Thank you for your reply. My sql query is very simple. select filename from a_table. There are like 45 files, taking that filename, I have to run 'rm' command a shell script.
---------- Post updated at 07:57 PM ---------- Previous update was at 07:55 PM ----------
Thank you for your reply. My SQL query is very simple. select filename from a_table. There are like 45 files, taking that filename, I have to run 'rm' command a shell script. How can I put a for loop in this command?