I have a table in oracle which has 2 columns
I have to take these as a variable in unix and then go to /home/bin and execute a unix command using these variables.
Considering that there is only one row in the table I was able to write the below but need help how to run for multiple rows in a loop
There is some confusion over the variable names, for instance sometimes you use a l and sometimes a1 I have assumed you want a number one rather tha a lower case L
For ksh, you might need something like:-
Does this get you closer? What I'm suggesting is to get the output from the whole table and the parse it, line at a time, into the two variables. It's been a while since I had a true ksh hence the use of a temporary file. That may cost a lot of time and space depending on your table size. If it is bigger, it would be better to pipe it into the while read statement but there are differences between ksh and bash (which is what I have) in this respect. I cant comment for zsh and I don't know if that is available to you anyway.
What OS and version are you running? It might give us other tools to do this more neatly.
Hello,
I've written a script to automate encoding of all the MP4 files in a directory (incl. subdirectories). But unfortunately it's running for the first MP4 file only.
My machine details:
root@Ubuntu16:~# uname -a
Linux Ubuntu16 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48... (2 Replies)
echo "The recreate was successfully completed for device file $LCL_CLN_FILE." >> $LOG_FILE
remaining=$(symclone -sid $LCL_SID -f $ETC/$LCL_CLN_FILE query | grep MB | awk '{print $2}')
if
then
while
do
echo "$remaining MB's to be copied........." >> $LOG_FILE
... (10 Replies)
Hi frnds
i am newbie in linux and trying to write a simple script for adding users.the problem is i am running a while loop under function and loop is running for 3 time more than limit.Here is my Script and output pls help me out :
# CREATE N NO. OF USERS WITH PASSWORD IN SYSTEM
#... (4 Replies)
Hi
I have a file called lastlogin_1 that contains a list of usernames. I would like to put together a quick loop script that will use a variable (the contents of lastlogin_1 file) and grep all directories and sub directories in the current directory (/in/the/current/directory) for each username... (3 Replies)
Hi,
I'm having a problem performing for loop on remote server, i know this can be done with one liner but i'm not sure how it works if using logical operator such as for ifs and case or while
for server in sterverA serverB serverC ; do
ssh -v $server "cd ~/MyDocuments/; bag=`find... (6 Replies)
HI.
I am trying to run 2 commands, using the "for x in a b c d" loop but i am having a hard time coding it...
Here is what i have so far:
for SERVER in SERVERA SERVERB SERVERC SERVERD SERVERE
do
###############################################################################
#... (5 Replies)
Hi Gurus,
Could you please help me to create a shell script that will be started by a cron job once every night at 24.00 h (that should bee easy:))
The shell script should control every 30 seconds the name of a process, and when the process doesn't run anymore it should execute a few further... (12 Replies)
I have a script that users a while read, whithin this I want to execute the cp -i command on some of the results, however because it is in a loop it skips the -i part of cp. How do I get the loop to stop each time cp -i is run and wait for the user to type the response. (2 Replies)
Hi
I have created a shell script which uses three nested loops. When the cronjob is running the script there is a for loop which call a function which has two nested for loops. It is going into the function but the for loop in the function is not running. Can someone pleasae give me a solution... (9 Replies)