Closing process on other side of pipe

  • Follow


Hi all,

I execute the following command,
$ tail -f <file name> | <my_awk_script>

On certain condition I want to exit from my_awk_script. But when I call
exit() from my_awk_script, though my_awk_script exits, "tail -f "
continues to run.
I want to exit from that also. Any idea how to achieve that?

Thanks,
Sriram.

0
Reply ramsankar (7) 7/5/2006 11:42:08 AM

ram <ramsankar@gmail.com> wrote:
> Hi all,
> 
> I execute the following command,
> $ tail -f <file name> | <my_awk_script>
> 
> On certain condition I want to exit from my_awk_script. But when I call
> exit() from my_awk_script, though my_awk_script exits, "tail -f "
> continues to run.
> I want to exit from that also. Any idea how to achieve that?

ctl-c
 
> Thanks,
> Sriram.
> 

-- 
Using OpenBSD with or without X & KDE?
http://dfeustel.home.mindspring.com 
0
Reply dfeustel 7/5/2006 12:18:15 PM


ram wrote:
> Hi all,
> 
> I execute the following command,
> $ tail -f <file name> | <my_awk_script>
> 
> On certain condition I want to exit from my_awk_script. But when I call
> exit() from my_awk_script, though my_awk_script exits, "tail -f "
> continues to run.
> I want to exit from that also. Any idea how to achieve that?
> 
> Thanks,
> Sriram.
> 

That's an OS question, not an awk question. Post it to comp.unix.shell 
if you're using UNIX.

	Ed.
0
Reply Ed 7/5/2006 12:51:57 PM

ram wrote:
> Hi all,
>
> I execute the following command,
> $ tail -f <file name> | <my_awk_script>
>
> On certain condition I want to exit from my_awk_script. But when I call
> exit() from my_awk_script, though my_awk_script exits, "tail -f "
> continues to run.
> I want to exit from that also. Any idea how to achieve that?
>
> Thanks,
> Sriram.
try
  "tail -f ..." |getline
within the prog rather than piping the output from tail. (Untested).

- Paddy.

0
Reply Paddy 7/16/2006 5:59:29 AM

3 Replies
242 Views

(page loaded in 0.079 seconds)

Similiar Articles:













7/26/2012 5:30:26 PM


Reply: