Automatic running of Shell scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automatic running of Shell scripts
# 1  
Old 03-18-2010
Automatic running of Shell scripts

Hi,

I have this problem of merging 2 shell scripts and run it one after the other. For eg: script A runs to give OutputA. This OutputA should become the input of script B which will run to give OuputB. Now this has to happen automatically i.e, script A and script B should run consecutively one after the other.

Additionally, the input to script A keeps changing after every cycle. Instead of inputting it manually everytime, it would be easier if this were automated so that the input file no. changes like 1,2,3 etc automatically and Output B is thrown out respectively.

How do i do the above? Any idea or suggestion would be thoroughly appreciated.

Thanks in advance..
# 2  
Old 03-18-2010
Let me introduce you to the fantastical concept in UNIX called pipelines, or "pipes" for short.

What you need can be reduced to a simple
Code:
cat input1 | scriptA | scriptB

or if you have a proper shell even a shorter
Code:
scriptA < input1 | scriptB

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running shell scripts from command

I have written a few shellscripts to run a videogame (starcraft) at different patched versions. For example bw113 runs the 1.13 version of the game. These works perfectly when I run them from command line (./bw113). However I cannot get it to work via mouseclick. Some Information: - I have... (5 Replies)
Discussion started by: lordsloth
5 Replies

2. Programming

running PLSQL scripts through shell script

I am running the following ealth checks on my server there are two databases in my server . MODEL1 and MODEL2 i connect with the first database as sqlplus model1/password Then i exceute a query select x from table (4 Replies)
Discussion started by: asalman.qazi
4 Replies

3. Shell Programming and Scripting

Long running shell scripts shuts donw the machine!

Hi, I am very new to shell scripting. I have a script called "RunDMol3.sh" which takes a directory name as input parameter, process somthing using files in the folder and writes output files in the same folder. This is a very heavy job and takes about 1.5 hrs. When I run in manually the script... (2 Replies)
Discussion started by: ramesh.jitkar
2 Replies

4. Shell Programming and Scripting

Running shell scripts automatically without using Batch or at commands

I have been trying to run a unix script which contains many sql statements.I need to run this script every monday morning. I tried to run on command prompt, it works fine. But while I run it via batch or at command., it returns with library module could not be loaded (libcompat.1.o could not be... (3 Replies)
Discussion started by: ritzwan0
3 Replies

5. Shell Programming and Scripting

Running shell scripts from web browser

I am in need of a mechanism to run shell scripts from web browser. Could any one of you guide me as to which technology to choose? I have some scripts which take some arguments. Appreciate you response. (7 Replies)
Discussion started by: corleone
7 Replies

6. Shell Programming and Scripting

Running SQL Scripts from Shell script - Need insight!

I've a script that fetches various values from the database as below: #! /bin/ksh $conn="user/pwd@service_name" `sqlplus -s << $conn EOF1 @xyz.sql @pqr.sql @abc.sql EOF1` The output of the script should generate txt files containing the results from queries which are further... (6 Replies)
Discussion started by: manthasirisha
6 Replies

7. UNIX for Advanced & Expert Users

unix shell scripts for running on solaris

am new to programmming any body suggest , how to execute, shell script interactively and like stream line edit (3 Replies)
Discussion started by: srini_ibmadmin
3 Replies

8. UNIX for Dummies Questions & Answers

running vendor shell scripts

Does anyone run a lot of SH (shell script) commands from vendors. i.e... product installations. And do you edit/change as a rule of thumb? I done a lot of product installs and some tend to think we should edit/change a vendors SH script. I am just looking for your thoughts. Thanks. (1 Reply)
Discussion started by: Javagate
1 Replies

9. UNIX for Dummies Questions & Answers

Running shell scripts on a remote server

Hi - I am running Mac OS X (Terminal) at my current workstation, and I would like to telnet to my local server to run a shell script. The local server is a Solaris machine (don't know the version or the type of Unix being run on it, sorry.) The problem I have is that when I create a #!/bin/sh... (2 Replies)
Discussion started by: pepintheshort
2 Replies

10. UNIX for Dummies Questions & Answers

Cron running shell scripts.

What are the rules of calling shell scripts in cron. How do I go about setting up the correct PATHS that calls a script, which then calls another sub script all of which has to retain the orginal PATHS and VARS that I've set up in first script Confused.. ok Well Cron calls a script... (3 Replies)
Discussion started by: cfoxwell
3 Replies
Login or Register to Ask a Question