Hi experts .
i have a script which will take parameters from a text file.
but now i need a script which will take 2 parameters from 2 different files or from a Excel sheet from 2 different columns.
i have the script as follows (which will take parameter from a txt file).
#/bin/sh
k="username"
p="password"
d="DB"
echo "executing sql query"
while read source
do
sqlplus -s $k/$p@$d <<EOI>>output.txt
set serveroutput on
set heading off
set linesize 200
set trimspool on
set echo off
set markup HTML off
set feedback off
set termout off
set pagesize 250
set verify off
set pages 1000
select * from Table where columnn like '%$source%');
EOI
done<input.txt
echo "COMPLETED"
Now i want a script which will read 2 parameters from different files.
hi danmero..
actually i am trying to create a script which will move all the files from Old server to new server.(2 different servers)
i have 2 files (old_paths.txt and new_paths.txt)
For each old path in old_path.txt there is a corresponding new path mentioned in the new_path.txt. (both the files contain absolute paths)
My script should take parameter from both the text files... and move all the files from old to new server ... the script which i have in my mind is something like as follows : (which i will run in new server)
#/bin/sh
USER="user"
PASS="password"
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASS
echo "copying the Files"
#echo "----------------------------"#
while read parameter1 parameter2 ------ this line is wrong
do
lcd $parameter1 ------ this line is wrong
cd $parameter2 ------ this line is wrong
mget *.*
EOI
done<input.txt
quit
END_SCRIPT
echo "COMPLETED"
ok, so assuming there is a 1:1 correspondence betw. lines in each file, i.e.,
you can paste these together into a param file
then you can iterate over that to populate an ftp macdef.
or if you can use sftp, you could instead put the contents of 'paste' into a var and iterate over the var to create a command batch file, and feed that to 'sftp -b [batchfile]'
by using a variable and then feeding that to a loop, you'll get alternating lines from each file:
Hi All,
I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them
abc.sh
----------
export Numbr_Parms=$#
export a=1
while
do
export... (3 Replies)
Hello All,
I have developed a script which takes following parameter from the input file to archive log files
1)Input Path
2)File pattern(*.csv)
3)Number of days(+1)
Following is the algorithm of my script
Read the input file
go to that path and search for particular n days older... (3 Replies)
Hi ,
I am not familiar with shell programming. I have a requirement like i have two files
.I need to compare the two files by comparing each parameter and i should produce 2 outputs.
1)i have around 35 parameters say i have one parameter name called db_name=dcap in one file and... (7 Replies)
Hello,
I have this awk script that I want to execute by passing parameters through a shell script.
I'm a little confused. This awk script removes duplicates from an input file.
Ok, so I have a .sh file called rem_dups.sh
#!/usr/bin/sh... (4 Replies)
Hello,
I'm a newbie in shell script.
So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2).
This script need to create 2 files as :
I need to create this file /etc/apache2/sites-available/PARAM2 :
<VirtualHost *:80>
DocumentRoot "/home/PARAM1/www"... (0 Replies)
Hello,
On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command.
tunrestore -R is present in inittab
in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log
... (0 Replies)
I want to call script2 from script1 passing parameters. I want to read the parameters list in script1, check the local directory (for example - lpath1|lpath2|lpath3|lpath4|lpath5|) for the existance of files and set the` lcount` to the number of files in this folder (`... (2 Replies)
hi all
i am etl guy
i have shell script that i use to do processing on file.
the problem is that i want it to use on multiple files at same time
is there any way of passing the file name since my all my filename start with samename like abc*
p,ease let me know (4 Replies)
Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files..
Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this?
Please tell me... (2 Replies)