How to terminate a tail -f

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to terminate a tail -f
# 1  
Old 08-28-2002
Error How to terminate a tail -f

I am developing a script with a tail -f in it. My problem is how to terminate it and execute the next line.
# 2  
Old 08-28-2002
It depends!

Why are you using tail -f in the first place? I imagine to print out something like a log file as it is being written. In that case you need to first ask yourself how do you know you are finished with the tail command - when the process writing to the file has finished?
# 3  
Old 08-28-2002
I would not use "tail -f" in a script. But you could launch it in the background, save the pid of the background job, sleep for a while, then kill the background job.
# 4  
Old 08-28-2002
I agree the tail in a script isn't such a flash method.... what is it you are trying to acheive? I'm sure we can come up with a better option.
# 5  
Old 09-12-2002
Thanks for your advice.

My problem is actually not a tail -f but it actually works just like it.

There is this system that is being used here in our company wherein we can check connectivity of server to server by a send and listen commands.

The thing is if we activate the listen command, it will not terminate automatically when it recieves the data from the sender unless we terminate it manually.

I was just thinking that if we could terminate such command by script, I can make a script wherein I can check connectivity for multiple boxes at the same time.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Terminate shell script after a specified time

I have a shell script that checks a file state.txt, deletes fit.bin if state.txt is empty. I cron this at 2am, I will want the script to stop by 8am irrespective of the value of state.txt, any ideas? #!/usr/bin/ksh while true; do if ] ; then echo else rm ~/fit.bin exit ... (8 Replies)
Discussion started by: aydj
8 Replies

2. Shell Programming and Scripting

Joining multiple files tail on tail

I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250. I would like to join all 250 of them together tail by tail as follows. For example stat.1000 a b c d e f stat.1001 g h i j k l So that my output... (2 Replies)
Discussion started by: kayak
2 Replies

3. Shell Programming and Scripting

Terminate a process using shell script

Hi, I am writing a shell script to run a process and write the output of the process to a file. Inside ./ > tempfile .. open tempfile do the following But the problem is that is running indefinitely and is not executed completely. Can... (4 Replies)
Discussion started by: dreamgirl314
4 Replies

4. UNIX for Dummies Questions & Answers

Terminate a port connection

I have executed a command which has ports that have to be assigned. then I deleted the files. Now I need to reinstall the command. but it says the ports are not free How to terminate the port connections and reinstall in solaris unix ---------- Post updated at 09:07 PM ----------... (7 Replies)
Discussion started by: sriki32
7 Replies

5. Solaris

Application terminate

OS : Solaris X86 gcc version 3.4.6 when i run my application, C with Motif application crashed and formed core. I collected the truss ouput. Incurred fault #6, FLTBOUNDS %pc = 0xFE8B35CD siginfo: SIGSEGV SEGV_MAPERR addr=0x00000275 Received signal #11, SIGSEGV siginfo:... (2 Replies)
Discussion started by: satish@123
2 Replies

6. Programming

command to terminate

hi all how to terminate command eecution process. can you please show me the way thank you (2 Replies)
Discussion started by: munna_dude
2 Replies

7. Shell Programming and Scripting

Terminate process

We have a system user "oracle_usr" always run some process in the system , but sometimes , these processes will not stop automatically until we terminate the process , can suggest the method how to terminate the process that is run by "oracle_usr" and run over 10 minutes ? thx (5 Replies)
Discussion started by: ust
5 Replies

8. Shell Programming and Scripting

terminate process

I want to have a script to terminate the system process that generated by user oracle_usr and have already processed for over 10 minutes , could suggest the script ? thx (1 Reply)
Discussion started by: ust
1 Replies

9. Shell Programming and Scripting

terminate the process

In my system , there are a system user "cronusr" , it is mainly to run the crontab job in the database .Sometimes the cronjob process will be failure ( due to some reason ) so that many cronusr process are in the system , it affect other process in the system , I want to have a script that can... (2 Replies)
Discussion started by: ust
2 Replies

10. Shell Programming and Scripting

Terminate session on completing script

Hai all.. How do i terminate my telnet session automatically when my java applicatiion exits. i have a file run which executes my java application and takes care of all class and library path settings prior to the execution. I would like to terminate my session when my application exits. The... (4 Replies)
Discussion started by: deepsteptom
4 Replies
Login or Register to Ask a Question