Sponsored Content
Full Discussion: tail -f for multiple files
Top Forums Shell Programming and Scripting tail -f for multiple files Post 302507970 by rateeshkumar on Friday 25th of March 2011 09:58:14 AM
Old 03-25-2011
adding to the thread ,

i think multiple tailing files comes with RHEL5 . i have that one . and am able to see tailed text for both the files. But is there any option is there so that i can switch to files or i can stop one in run time ..

Just came to mind while reading the thread.....
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tail-alike display of new files in directory

The system I work on, produces several kinds of status-files in a single directory. I would like to be able to see the files as they are added to this directory. I was wondering if it would be possible to get a "tail -f" alike view of the ls-command, in such a way that a newly added file is... (4 Replies)
Discussion started by: rschelkers
4 Replies

2. UNIX for Dummies Questions & Answers

Constantly updating log files (tail -f? grep? awk?)

I have a log file which is continuously added to, called log.file. I'd like to monitor this file, and when certain lines are found, update some totals in another file. I've played around with tail -f, grep, and awk, but can't seem to hit the right note, so to speak. The lines I'm... (0 Replies)
Discussion started by: nortonloaf
0 Replies

3. Shell Programming and Scripting

Drop common lines at head/tail of a large set of files

Hi! I have a large set of pairs of text files (each pair in their own subdirectory) and each pair shares head/tail (a couple of first and last lines) but differs in the middle part. I need to delete the heads/tails and keep only the middle portions in which they differ. The lengths of heads/tails... (1 Reply)
Discussion started by: dobryden
1 Replies

4. Solaris

Tail for multiple files

Hi there, I'm trying to run a simple command in Solaris 10: tail -10 *.log But this gives me in the output just last 10 rows of a SINGLE log file :eek: (and there are many in active directory). Please, do you have any idea what's the problem? :confused: Is it a Solaris issue? Thank you in... (2 Replies)
Discussion started by: MartinF
2 Replies

5. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

6. Shell Programming and Scripting

head / tail combination returns multiple rows

Hi, As part of our project, we need to load historical data for a year before our system is live. We have the data feed files that we need to load. However, I need to make sure that the file structure (number of fields separated by a comma) on the field is same for all the files of the same... (1 Reply)
Discussion started by: raj.jha
1 Replies

7. Shell Programming and Scripting

Multiple tail -f commands

I need to execute a program which will generate some alarms. I wish to capture those alarms in a single output file. I executed with following command on linux: tail -f test1.alarms -f test2.alarms|awk 'NR>20' >> output But however when I tried to execute same on solaris platforms it fails.... (2 Replies)
Discussion started by: bhallarandeep
2 Replies

8. Shell Programming and Scripting

how to run tail -f for 3 log files from a script

hi i need to run from a bash script tail -f /var/log/access_log >> access1 tail -f /var/log/prod/prod1 >> access1 tail -f /var/log/prod/prod2 >> access1 this script purpose is to start at server boot time and should always run. what is the best way to put it on a script Thanks Dan (1 Reply)
Discussion started by: dan12341234
1 Replies

9. Shell Programming and Scripting

prevent multiple tail in back ground

Dears i have a scrip run in unix that need to use the tail -f command, as below: DATE=`date '+%m%d%y'` tail -f /var/messages | grep "start" >> /export/logs/start_${DATE}.out but the problem that the tail -f will be stop and working in the background in then end of the day (23:59:59)... (0 Replies)
Discussion started by: thehero
0 Replies

10. 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
MI_SWITCH(9)						   BSD Kernel Developer's Manual					      MI_SWITCH(9)

NAME
mi_switch, cpu_switch, cpu_throw -- switch to another thread context SYNOPSIS
#include <sys/param.h> #include <sys/proc.h> void mi_switch(void); void cpu_switch(void); void cpu_throw(void); DESCRIPTION
The mi_switch() function implements the machine independent prelude to a thread context switch. It is called from only a few distinguished places in the kernel code as a result of the principle of non-preemptable kernel mode execution. The various major uses of mi_switch can be enumerated as follows: 1. From within a function such as cv_wait(9), mtx_lock, or tsleep(9) when the current thread voluntarily relinquishes the CPU to wait for some resource or lock to become available. 2. After handling a trap (e.g. a system call, device interrupt) when the kernel prepares a return to user-mode execution. This case is typically handled by machine dependent trap-handling code after detection of a change in the signal disposition of the current process, or when a higher priority thread might be available to run. The latter event is communicated by the machine independent scheduling routines by calling the machine defined need_resched(). 3. In the signal handling code (see issignal(9)) if a signal is delivered that causes a process to stop. 4. When a thread dies in thread_exit(9) and control of the processor can be passed to the next runnable thread. 5. In thread_suspend_check(9) where a thread needs to stop execution due to the suspension state of the process as a whole. mi_switch() records the amount of time the current thread has been running in the process structures and checks this value against the CPU time limits allocated to the process (see getrlimit(2)). Exceeding the soft limit results in a SIGXCPU signal to be posted to the process, while exceeding the hard limit will cause a SIGKILL. If the thread is still in the TDS_RUNNING state, mi_switch() will put it back onto the run queue, assuming that it will want to run again soon. If it is in one of the other states and KSE threading is enabled, the associated KSE will be made available to any higher priority threads from the same group, to allow them to be scheduled next. After these administrative tasks are done, mi_switch() hands over control to the machine dependent routine cpu_switch(), which will perform the actual thread context switch. cpu_switch() first saves the context of the current thread. Next, it calls choosethread() to determine which thread to run next. Finally, it reads in the saved context of the new thread and starts to execute the new thread. cpu_throw() is similar to cpu_switch() except that it does not save the context of the old thread. This function is useful when the kernel does not have an old thread context to save, such as when CPUs other than the boot CPU perform their first task switch, or when the kernel does not care about the state of the old thread, such as in thread_exit() when the kernel terminates the current thread and switches into a new thread. To protect the runqueue(9), all of these functions must be called with the sched_lock mutex held. SEE ALSO
cv_wait(9), issignal(9), mutex(9), runqueue(9), tsleep(9), wakeup(9) BSD
November 24, 1996 BSD
All times are GMT -4. The time now is 12:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy