Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I posted a query a short while ago and had an informed answer within a couple of hours. Terrific!..."

Geography

Where in the world do Tek-Tips members come from?

tail the output and run another script without forking

max1x (Programmer)
19 Apr 11 12:20
My first script creates an output file, which the second script needs to parse real-time.  Using system command, I was teeing and tailing the files as follows

system("sc1.pl | tee out1.out | tail -f out1.out | sc2.pl | tee out2.out");

Both the output files get created but are empty.  I can't install any modules on the machine I'm on so forking is not possible.  Any simple solution I'm overlooking?
travs69 (MIS)
19 Apr 11 22:33
why not use multiple system calls instead of trieng to pipe them all?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noevil
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;

max1x (Programmer)
20 Apr 11 10:54
I tried that as well.  The 1st output files starts and increments, but it's does not seem to get tailed for input for the second script.  
travs69 (MIS)
20 Apr 11 10:59
idk, what your doing just seems incorrect but maybe I don't understand.  D

o you control scp1 and scp2.  Is this a daemon of some kind or does it just run once?

If it just runs once why isn't it all in one script?

Can you just call scp1 > out1.out.
then call cat out1.out | scp2 > out2.out ?

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noevil
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;

max1x (Programmer)
20 Apr 11 11:13
it works when I do it in a different term window.  I'm tring to do real time parsing.  The output files have rw for the users, so I don't think it's locked.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close