Hi,
I am stuck into a situation where i want to execute a command in my shell script well along with a previous command in order to achieve something but i am not figuring out a way.
here is a snippet:
in the above, if you see, i am trying to restart a service first.
What happens is that as soon as that command of restart starts running, there is a temporary lock file created.
However, that lock file is causing some performance issues (the restart takes a long time because of the lock file).
Now, i want to override this event by deleting the lock file as soon as the restart command runs.
so, i am looking for way where i can delete the file as soon as the restart command starts running, which i am sure will solve my problem
Is there any way where i can run both commands in parallel (executing both commands together)
Please can any one guide me on this ?
Thanks.
The '&' will put the job in background. but it does not move to the next command to execute until the existing job is complete.
so, in my case, the rm command will still wait until the job in the background completes.
ok .. now there is one more thing we might need to do while doing things in parallel.
suppose there 4 commands
cmd1,cmd2, cmd3, cmd4
goal is :
run cmd1 and cmd2 in parallel, once both are done move on to execute cmd3 and cmd4 in parallel, exit the script once both are done
answer:
_____________
_____________
Last edited by Franklin52; 03-25-2011 at 07:15 AM..
Reason: Please use code tags, thank you
Hi Folks,
I have requirement to pull a bunch of SQL's from a table in DB and execute them in parallel and update the status of each query as and when they complete. Can you please help me with ideas on how this can be achieved?
create table list_of_sql
(
id number,
full_sql... (3 Replies)
Hi all.
Long time!!
Hope you're doing well..
I've stumbled on a peculiar siutaion here, and would expect help from this forum on a clean resolution.
We are running an rm and find command simultaneously from two different Unix sessions of the same user(let's say USER01) and on the same... (3 Replies)
I have n number of SQL queries needs to executed in Shell. Result of this query need to assign in a variable. Once all the queries are executed script needs to exit.
Sample Query:
SQL 1: Select Count(*) from TABLE GROUP BY COL1,COL2
SQL 2: Select Count(*) from TABLE GROUP BY COL1,COL2
... (2 Replies)
Hi Experts,
There is a shell script that accepts positional parameter between 1-25 to execute case statement of script depending upon the parameter passed.
Now I need to run all the 25 sessions parallely. In each option of case statement it is connecting with sqlplus and executing a select... (11 Replies)
I need to execute a command to run my script several times with varying parameters
perl ex.pl -b 130198 -e 130884 -c plot plot.txt 1_plot.txt
perl ex.pl -b 1345 -e 1308 -c plot plot.txt 2_plot.txt
perl ex.pl -b 1345567 -e 130898 -c plot plot.txt 3_plot.txt
.
.
.
100's of excutions
... (2 Replies)
Hi,
I want to run these two commands one after the other.
awk 'BEGIN {OFS="\t"} {print $2}'
sort -u
rather than typing awk 'BEGIN {OFS="\t"} {print $2}' file1 > file2, then sort -u file2 > file3. Is it possible to run both commands on file1 then get output file3?
Its kinda hard for... (5 Replies)
Hi Folks,
I have a small doubt, the binary commands under /bin and /sbin as well as other path binary files, if you peek deep into that, you can find the difference in the way of normal perl programming and some commands will be like binary files. how are the commands executing like the... (3 Replies)
Hi All,
I have 3 shell scripts, Script1,Script2 and Script3. Now I want to run Script1 and Script2 in parallel and Script3 should depend on successful completion of both Script1 and Script2.
Could you please suggest an approach of acheiving this...
Thanks in advance (2 Replies)
Hi,
please can someone point me in the right direction with a shell scripting problem.
I want to execute a command in a for loop and the command should be started not one-by-one meaning the for loop is waiting for the exit code , it should be started in parallel.
I have a plain text file... (3 Replies)
Basically, I would like to run an mpirun query on my web server to query your databases via yours when using the BLAST program, however the server seems not able to execute even basic mpirun programs such as cpi (to calculate pi). Are there any settings I should take note of?
I am running Perl... (0 Replies)