|
How to send filename as variable in a shell script
Can we can pass the filename as variable in the shell script.
Sending the filename as a parameter file, the shell script takes the filename, needs to replace the string containing the filename with the variable in the shell script.
EX: test1.sh is the shell script and takes file1.csv as parameter file. Then file1.csv has to be replaced in the test1.ctl file where the control file contains the infile option taking as test1.csv
From the command line execute
test1.sh file1.csv
#Take the file1.csv file and replace it in test1.ctl
#test1.ctl
load data
infile 'testing.csv'
......
......
Here the testing.csv has to be replaced by 'test1.csv' in the test1.ctl file. Hope the scenario is clear and any solution is greatly appreciated. Thanks.
|