running files consecutively with one command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting running files consecutively with one command
# 1  
Old 10-15-2005
Question running files consecutively with one command

i want to run few c object files one after another in one command. Can i write a acript for that. I'm using Sun Solaris.
for example

./prog < input1 >output1 &
./prog <input2 >output2 &

i want the first to finish before starting the nest one and run them in the back ground

thanks.
p/s hope fully this is the right thread to ask
# 2  
Old 10-15-2005
( ./prog < input1 >output1 ; ./prog < input2 >output2 ) &
# 3  
Old 10-15-2005
Bug What if i have more than 10 files?

can i write a script for that so that
1. I can change the parameter
2. I don't have to retype all again everytime...

thanks.
# 4  
Old 10-15-2005
running from different directory

say i have three executable code from three directory,
I want to run them consecutively as i have posted before from the main directory.
i tried ( /program1/./prog <input >output; /program2/./prog <input >output)&

if give me error no such files or directory

thanks... Smilie
# 5  
Old 10-15-2005
You can put that syntax in a script and use variables with it, etc. Not limited to 2 programs. With 10, you might switch to:

(
./prog < input1 >output1
./prog < input2 >output2
) &
# 6  
Old 10-15-2005
Quote:
Originally Posted by narom
say i have three executable code from three directory,
I want to run them consecutively as i have posted before from the main directory.
i tried ( /program1/./prog <input >output; /program2/./prog <input >output)&

if give me error no such files or directory

thanks... Smilie

Well then the file it complained about must not exist. "/program1/./prog" is silly. Just use "/program1/prog" and that file must exist. If you can't do:
/program/prog
then putting it in parenthesis will not help.

Do Not Omit Spaces!

output)&
that is not what I used.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Another one line command where I'd like to determine if Ubuntu or Red Hat when running command

Hello Forum, I'm making very good progress on my report thanks to the very helpful people on this forum. I've been able to successfully create my report for my Red Hat servers. But I do have a few ubuntu servers in the mix and I'd like to capture some data from them when an ssh connection is... (8 Replies)
Discussion started by: greavette
8 Replies

2. AIX

I'm facing problem with rpm command, when running the command and appears this error:

exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors: 0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.1). 0509-150 Dependent module /opt/freeware/lib/libiconv.a(shr4.o) could not be loaded. 0509-152 Member... (4 Replies)
Discussion started by: Ohmkar
4 Replies

3. Shell Programming and Scripting

Command to check only Autosys running jobs with autorep like command

Hi, Is there any specific command to use to check only say Running jobs via autorep or similar command for Autosys? (0 Replies)
Discussion started by: sidnow
0 Replies

4. Shell Programming and Scripting

Can I skip files when running rm command

Platform: Oracle Enterprise Linux 6.2 I have several files like below. I want to remove all files except one file For example , I want to remove all the files below except dasd_91197.trc $ ls -alrt *.trc -rw-r----- 1 ecmdev wms 8438784 May 7 21:30 dasd_91177.trc -rw-r----- 1 ecmdev wms ... (3 Replies)
Discussion started by: John K
3 Replies

5. Shell Programming and Scripting

HOW TO - Bash REGEX - Print Error when More then One Occurence is Found Consecutively?

Hello All, Bash Version: 4.1.10(1) I'm trying to "verify" some user input. The User input will contain the "Absolute Path" a "Command" and any "Options" of that Command. For Example, say the user's input is: user_input="/usr//local/myExample/check_process -p 'java' -w 10 -c 20" I... (6 Replies)
Discussion started by: mrm5102
6 Replies

6. Shell Programming and Scripting

Automate the process of running jobs on several directories consecutively

Hi, I have about 10 directories in which I run the same code. But this code is only run in a directory when the computation in the previous directory was successful (explained below). My directories are named as : VF_50, VF_100, VF_150, VF_200............. As you can see the number after _... (6 Replies)
Discussion started by: lost.identity
6 Replies

7. Shell Programming and Scripting

Running rename command on large files and make it faster

Hi All, I have some 80,000 files in a directory which I need to rename. Below is the command which I am currently running and it seems, it is taking fore ever to run this command. This command seems too slow. Is there any way to speed up the command. I have have GNU Parallel installed on my... (6 Replies)
Discussion started by: shoaibjameel123
6 Replies

8. Shell Programming and Scripting

Command running for all recursive files

hi, I have installed ACL(access control list) in my ubuntu box in order to know which all are the users having permissions to read and write the files; If u run the command like; $getfacl /root/ It will give following output: # file: root/ # owner: root # group: root user::rwx... (2 Replies)
Discussion started by: ajaypadvi
2 Replies

9. Shell Programming and Scripting

Running a command on multiple selected files in nautilus script

I am trying to make a script to convert drg files to wav and so far i have this #!/bin/bash drg2sbg "$*" -o "$*".sbg sbagen -Wo "/home/nick/Desktop/I-Doser Wave Files/"$*"" "$*".sbg rm "$*".sbg cd "/home/nick/Desktop/I-Doser Wave Files" rename 's/\.drg$/\.wav/' *.drg exit the drg2sbg and... (2 Replies)
Discussion started by: Nickbowlingdude
2 Replies

10. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies
Login or Register to Ask a Question