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..

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

cat input1 | scriptA | scriptB

or if you have a proper shell even a shorter

scriptA < input1 | scriptB