Home » Infrastructure » Unix » Shell Script Directory Listing
icon9.gif  Shell Script Directory Listing [message #243280] Wed, 06 June 2007 13:42 Go to next message
Messages: 32
Registered: May 2007

I am trying to dynamically create a control file within a shell script to load data files using sql loader. control file is being created. problem comes when searching folder for data files. all data files have extension .dat. for recursively scanning directory im using the following:

for V_DATA_FILE IN 'ls -1 $V_DATA_DIR'

but this is not working. intention is to load all the files in the directory using control file. does anyone know how to do this.

Re: Shell Script Directory Listing [message #243284 is a reply to message #243280] Wed, 06 June 2007 14:28 Go to previous messageGo to next message
Messages: 24971
Registered: January 2009
Location: SoCal
Senior Member
>this is not working
Your problem statement is not working.
My car is not working.
Please tell me how to make my car go.
Alternatively, you might be able to use the "find" command.
Re: Shell Script Directory Listing [message #243318 is a reply to message #243284] Wed, 06 June 2007 19:38 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member

it's not clear to me if wildcards work or not - but you can load 1 at a time...

$ sqlldr / t data=`ls -tr PDNL*.dat | tail -1`
Previous Topic: ORA-01033: ORACLE initialization or shutdown in progress
Next Topic: error when executing a shell script(which contains oracle express commands) present on remote server
Goto Forum:

Current Time: Fri Oct 28 01:42:29 CDT 2016

Total time taken to generate the page: 0.13635 seconds