Background info :
Linux machines, /bin/bash shell .
I have several remote machines. I want to create a variable for each of these remote machines, by retrieving some data remotely for each of them. As this may take some time for each remote machine, I want to launch these commands woth a for command and to set in background each loop.
Like this :
After a second (the ssh commands are already finished) I press an enter and I get this in my prompt (some info regarding my background commands.
As you can see the background commands weren't executed, therefore I have no value in the variables server1_nr and server2_nr. The whole chain of commands works fine, otherwise, if I don't send it in background :
What am I doing wrong ?
---------- Post updated at 08:08 AM ---------- Previous update was at 06:52 AM ----------
A short update :
I think the problem is not so much related with the fact that I'm using a looping statement but with the fact that I cannot create a variable in background (the process of creating the variable itself to be set in background) :
I think it is because if i sent the command "var=78" in background, a separate shell is created, therefore, the variable var will exist only in that shell.
How can I overcame that ?
#!bin/ksh
---------------------------------------------------------------------------------------------
-- Get sequence number from database
---------------------------------------------------------------------------------------------
.os rm... (3 Replies)
Hello All,
I am using Linux. I have two scripts:
inner_script.ksh
main_wrapper_calling_inner.ksh
Below is the code snippet of the main_wrapper_calling_inner.ksh:
#!/bin/ksh
ppids=() ---> Main array for process ids.
fppids=() ---> array to capture failed process ids.
pcnt=0 --->... (5 Replies)
Hi guys,
I am creating a script that checks if a service is UP and running on a bunch of remote servers.
My list of servers is:
p2 runtime1 8080
p3 runtime2 8080
p4 runtime3 8080
p5 runtime4 8080
p6 runtime5 8080
p7 runtime6 8080
p8 runtime7 8080
p9 runtime8 8080
p10 runtime9 8080... (4 Replies)
I have written the below query to genrate a telephone.I am passing account number from oracle database.
I am calling 2 scripts which generate the bill
1. bip.sh (it runs in the background)
2.runXitInvoice_PROFORMA_integ
bip.sh generates a number which runXitInvoice_PROFORMA_integ
uses.How... (7 Replies)
Hello,
I'm a UNIX SysAdmin at a large webhosting company and we have a vendor that provides a service which involves the ftp'ing of files from their servers to ours. They initiate FTP using a perl script with NET::FTP.
When they try to transfer files (and delete files over ftp), there is... (3 Replies)
Hi evryone
i need a help .
i have a file xcv.the content is :
accelerate
i want a script which will run 1000 times in loop and changing the value to
accelerate to
acceler
in 1st loop and in 2nd loop it will be again
accelerate and so on . (6 Replies)
I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test.
The expect script is run... (2 Replies)