script with a sequence of nohups


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users script with a sequence of nohups
# 1  
Old 08-04-2009
script with a sequence of nohups

Hi,

I have written this script below to run a mathematica notebook, and then I want to launch another one when the first one finishes doing what it must. The notebook includes a command which will exit the program math. If I do it like below the two math processes begin at the same time, and this is not what I need. Perhaps I need an intermidiate command to stop the nohup.

Can you help me? Thanks

Code:
 

#!/bin/bash
nohup math < chain1.m
nohup math < chain2.m

# 2  
Old 08-04-2009
have a play with:

Code:
#  date; sleep 5 && date
Tue Aug  4 12:30:34 BST 2009
Tue Aug  4 12:30:39 BST 2009

or

#   nohup sleep 5 & date ; wait ; date
[1] 50117
Tue Aug  4 12:30:58 BST 2009
Sending output to nohup.out
[1]+  Done                    nohup sleep 5
Tue Aug  4 12:31:03 BST 2009

HTH
# 3  
Old 08-04-2009
not there yet

I tried

nohup math < chain1.m ; sleep 5 && nohup math < chain2.m &

and did not do what I wanted. The question is math < chain 1. m takes more than 5 secs. So I guess I would have to calculate how long it is going to take and use this value in sleep.

What I need is something that works even if the time it takes to finish the first process in not known.

Thanks
# 4  
Old 08-04-2009
erm - the sleep was just for example...

you should be able to just do:

Code:
cmd1 && cmd2 etc

or use wait to wait on the process...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Will shell script executes in sequence

I have a shell script scheduled in cron job to run at every 1 minute which transfers files to remote machine and then move the files to backup folder. cd /u01/app/ftp_tmp sftp user@hostname <<-EOF cd /home/user/ftp mput * bye EOF mv /u01/app/ftp_tmp/* /u01/app/ftp_bkp Now the problem is... (6 Replies)
Discussion started by: Bhavi
6 Replies

2. Shell Programming and Scripting

Script to generate sequence of numbers

I need awk script to generate part number sequencing based on data in multiple columns like below Input File --------- Col A|Col B|Col C| 1|a|x| 2|b|y| |c|z| | |m| | |n| And out put should be like 1ax 1ay 1az 1am 1an 1bx 1by (6 Replies)
Discussion started by: aramacha
6 Replies

3. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

4. UNIX for Dummies Questions & Answers

bash script to parse sequence...

Hi, I have 4000 list files and 4000 sequence data files. Each list file contains a number of 'headers' and data file contains 'header and data'. I would like to extract data from the data file using the list file and write into a new file. As each of the files are quite large, an efficient piece... (6 Replies)
Discussion started by: Fahmida
6 Replies

5. Shell Programming and Scripting

Script to check file sequence

Hi everyone, I need help in creating a script that would check if the file sequence is in order in a particular directory. These are log files that are generated throughout the day. Example of the file name will be, ABC01_YYMMDDHHMM###### (ABC01_0904161829000001) Sometimes the file... (4 Replies)
Discussion started by: kumaran21
4 Replies

6. Shell Programming and Scripting

script to touch a sequence of files

Hi, My requirement is i need to touch a sequence of files like touch a touch b touch c now i need the script in a way that checks if all files are touched or not. if any file say b is not touched then i should get this notification. Please suggest as i am new to unix (2 Replies)
Discussion started by: sussane
2 Replies

7. Shell Programming and Scripting

Unix script for Checking sequence

Hello, I need Unix script for Checking sequence and get output in a file for missing sequences information. We are moving archive log to a server for DR .if any files miss from sequence DR will fails. so we need script to monitor sequence of files which are FTP from the Production servers .... (2 Replies)
Discussion started by: Rata_raj
2 Replies

8. Shell Programming and Scripting

help - script can check jump sequence?

Hi, if I have a lot of files like (AABBCC0010, AABBCC0011, AABBCC0012....AABBCC1000), can I write a small script to check any sequence number jump and show me the result which sequence number? #The first sequence may start from 0010 or 0101... :confused: Thank you!! (10 Replies)
Discussion started by: happyv
10 Replies

9. Shell Programming and Scripting

script to ensure lines are in sequence

Hello there, I check files containing more than 2000 lines, I try to make sure that the lines are in sequence...for example the first line begins with Av567, second line contains Av568 and so on up to the last line that may contain Av2500. I need a script to check that all lines are in sequence... (5 Replies)
Discussion started by: docaia
5 Replies

10. UNIX for Dummies Questions & Answers

Script in boot sequence

Hi , I have some problems with my library when the sytem boot : When HPUX is booting, HPUX and STAPE claim the drive initially. HPUX assigns an instance number. The instance number is tied to the hardware path. Near the end of the boot, the ATDD driver claims the drive from STAPE based... (1 Reply)
Discussion started by: delphine
1 Replies
Login or Register to Ask a Question