Command to execute commands one after other


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Command to execute commands one after other
# 1  
Old 09-21-2010
Command to execute commands one after other

I am writng a script in which there is an installation file.The installer runs good. But after the installer command there are some files and commands which are based on those installed files. Now problem is the commands get executed before the installer is totally installed. So is there any command which stops the execution other commands untill the installer is completely done.

suppose installer is ./runinstaller -silent

cp /root/user/(installed file)

problem is installed file is executed before run installer is completely installed
error :cant find the file
# 2  
Old 09-21-2010
Code:
nohup ./runinstaller -silent 2&>1 > nohup.out &
wait

runinstaller is now background process, waited for by your command line process
# 3  
Old 09-21-2010
Quote:
Originally Posted by sriki32
Code:
./runinstaller -silent
wait
cp /root/user/(installed file)

# 4  
Old 09-21-2010
Probably that install script runs some other scripts or processes in the background and it is not waiting for them to finish. You can use this line of code to halt your script until the file apears (but it may not be copied completely, so add some sleep timeout after that).
Code:
while :; do if [ -f ~/test ]; then break; fi; done

# 5  
Old 09-21-2010
its takes 72 minutes for installation. so is wait a command . If so wats the syntax to wait for specific time to execute the further commands

./runinstaller -silent
wait

---------- Post updated at 10:25 AM ---------- Previous update was at 10:08 AM ----------

or is there way to find process Id of that installer and wait until the process is done
# 6  
Old 09-21-2010
Quote:
Originally Posted by bartus11
Probably that install script runs some other scripts or processes in the background and it is not waiting for them to finish. You can use this line of code to halt your script until the file apears (but it may not be copied completely, so add some sleep timeout after that).
Code:
while :; do if [ -f ~/test ]; then break; fi; done

Try using 'fuser' to determine if the file has been completely copied.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to take input from the user from the command line and execute commands basedon that?

Hi, I am using solaris 10 and bash shell.Script execution follows below.Initially it will check whether a directory exists or not if does not exist it will create it.(This I have completed) Second step:I have four users say user1,user2,user3,user4.Script should prompt for the user id and... (11 Replies)
Discussion started by: muraliinfy04
11 Replies

2. Shell Programming and Scripting

Shell: How to execute commands from another file?

I made a configuration file for my shell script in that all the values that the shell scipt needs, are defined, but I don't know how to let the shell script use those defined variables. Thank you for your help :) (3 Replies)
Discussion started by: Alkali
3 Replies

3. Shell Programming and Scripting

execute multipe commands

I would like to execute multipe commands in a shell script. Please provide the commands for the below scenario: Execute command1 if command1 is succesfull, then execute command2, command3,command4 in parallel if command2, command3,command4 are success then run command 5 (3 Replies)
Discussion started by: p_gautham12
3 Replies

4. Shell Programming and Scripting

Execute 2 Commands at the same time

Hi @all I have got the following problem: I want my Master-Script to execute 2 Sub-scripts at the same time. How can i realize that? Thx for your help Greez Roger (2 Replies)
Discussion started by: DarkSwiss
2 Replies

5. Shell Programming and Scripting

ssh - to execute set of commands

Hi Can someone help me to figure out Want to execute few cmds in remote host thru ssh Tried below cmd -------------------------------excerpt------------------- RDIR=/data1/logs ---> variable stores rem. server directory TODAY="`date '+%b %d'`" ssh -i $userid@$host "cd... (2 Replies)
Discussion started by: id100
2 Replies

6. UNIX for Dummies Questions & Answers

cron used to execute multiple commands

have to run multiple commands at a specified time by the user... (3 Replies)
Discussion started by: hemaa
3 Replies

7. Shell Programming and Scripting

execute shell commands with in sftp

Hi All, Please let me know how do I execute some of the shell commands like cat, find ,grep within sftp. Any help in this regard would be greatly appreciated. Thanks, (5 Replies)
Discussion started by: tommy1
5 Replies

8. Shell Programming and Scripting

Execute multiple commands in a find

I am checking that a file is older than a reference file that I build with a touch command before processing it. If it is not old enough, I want to sleep for an hour and check again. My problem is if it is old enough to process, I want to exit when I am done, but I cannot find a way to exit... (2 Replies)
Discussion started by: prismtx
2 Replies

9. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

10. Solaris

lom don't execute commands

I'm new in Sun, i just recieved a sun v100 server, i already connected the server to a workstation (using the hyperterminal tool) and it seemmed to be fine... however when the LOM> prompt appears and i try to introduce various commands but it does nothing. LOMlite starting up. CPU type:... (6 Replies)
Discussion started by: pasalagua
6 Replies
Login or Register to Ask a Question