Hi, I have a requirement in which i have to read a csv file and put data in certain set of variables:
File content:
This is the code i have written:
My problem: The assignment is not working since the LHS of the assignment is also varying.
Error: ACTN_01_NM=VP-DTL-REC-CNT: not found
Its trying to execute this statement.
Can anyone suggest me how to do this using korn shell script, is it possible to use a varying value on LHS of assignment?
Quick help is appreciated.
Last edited by pludi; 02-19-2010 at 12:49 PM..
Reason: code tags, please...
It should definitely be easier if you explain what exactly you're trying to achieve.
Bare in mind that the pure shell is not the most appropriate tool for processing text files.
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)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
hi everyone,
i'm writing shell script on hp-ux server that run by root user then (inside the script) su to database user and appl user..the reason for this script is to run some commands involve all users root and database and appl..anyway, variables when root in control is ok but when su, the... (1 Reply)
mysqldump --compact --add-drop-table -h192.168.150.80 -uroot -p somePass $combined | sed '/$combined/$table/g' | mysql $databaseThe sed part is not working from the above statement.
The variables combined and table are already defined and instead of showing the actual variable, it is executing the... (4 Replies)
Hi All,
I have a shell script called sample1.sh where I have 2 variables. Now I have another shell script called sample2.sh. I want the variables in sample1.sh to be available to sample2.sh.
For example. In sample1.sh I am finding the sum of 2 numbers namely a and b. Now I want to access... (2 Replies)
I have a variable $exe in a shell script file a.sh which I need to access in another shell script file b.sh. How can I do that? :rolleyes:
Thanks!! (2 Replies)
HI guys
I need to store the output of a sql query in a variable, can you tell me how to do that
eg) select count(*) from s_escl_req
$count = count(*) from s_escl_req
how would i store the count(*) from the sql statement in a variable called $count.
thanks (3 Replies)
Hi,
I'm in the midst of writing a UNIX script that sftp's files to an external host and am stuck with a problem. The problem is that the files created on my server as a order number that correlates to a sequence of directories on the remote host which is where the file should be ftp'ed.
... (3 Replies)