sqlldr in shell script

Hi

I'm using SQL*Loader in shell script as below

sqlldr $uname/$pword@$ORACLE_SID parfile=$test.par

for e.g. if $test is 'file1'

and getting the below error

LRM-00109: could not open parameter file 'file1'
LRM-00113: error when processing file 'file1'


SQL*Loader: Release 11.2.0.1.0 - Production on Thu Jul 28 14:37:59 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

SQL*Loader-100: Syntax error on command-line

but the actual file which exists is file1.par Is it not recognising $test.par

Thanks

Try

${test}.par

Still I'm getting the same error

Are you running this from cron perhaps ?
If you are, please specify full path to par file
or cd into DIR where the par file is and execute sqlldr.

I'm running by executing a shell script, given absolute path same error.

I ran in unix prompt sqlldr by giving just the name of the par file without path(ctl, par all in the same directory) it works. It did not work when executing in the shell script.

Thanks

So you are saying :
You run sqlldr from command line with file1.par as parameter and it works ?
But after you put it in a shell script, you are getting error above ?

If above is true please :
Put set -x as second line of the script.
Put exec 2>>/path/to/log.log as next line
Also you might want to put some echo $test aswell.
Run the script and post the output of script and log.log here.

Regards
Peasant.

I'm using the below command but .txt is appended to the beginning of the file names not in the end. how to display it like filename.txt?

for test in `cat files.lst`; do echo $test".txt"; done

.txtrce
.txt
.txtge
.txttion
.txt
.txtheist
.txtave
.txt_tion

Thanks

Since i don't know the content of files.lst, i can only guess.

Try this :

for i in $(awk ' { print $1".txt" } ' files.lst)
do
echo $i
done

Please check that files.lst is in unix file format.

Also, i guess you solved the sqlldr issue?
You should open new thread for new problems.

Regards
Peasant.