Tailing new log file & echo the string on console


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tailing new log file & echo the string on console
# 1  
Old 02-01-2010
Tailing new log file & echo the string on console

Guys,

I do have a script that runs to take the server out from network, after running the script it is writing the new log file{outFile} in to directory . Now what i need is my script should tail the last modified file{outFile} & search the string {Server Status} ans should echo the same at the output statement.

This is an sample output statement , where server status is not shown.

Code:
./removeserver.sh server123 disable

 Preparing to service at request to Device tdad6324-ra in Question . . .

 Node does exist

 Disabling the Device in few seconds

Do some one can guide how to go about it.

Last edited by raghunsi; 02-02-2010 at 11:15 PM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Enhance existing script: Extract Multiple variables & Input in an echo string

Hi Experts I need your help to optimize my script to execute better as I have nearly 1M records & the script is taking close to 40 minutes to execute, so would need support on a faster alternative. Input: file {"house":"1024","zip":"2345","city":"asd","country":"zzv"}... (2 Replies)
Discussion started by: nk1984
2 Replies

2. UNIX for Beginners Questions & Answers

Print Error in Console and both Error & Output in Log file - UNIX

I am writing a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file. But i am facing the below error. #! /bin/sh errExit () { errMsg=`cat... (1 Reply)
Discussion started by: sarathy_a35
1 Replies

3. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

4. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

5. Shell Programming and Scripting

File Reading for a certain string and echo the line before

Hi Guys, I have a big file like this. It has cache group line ( the bold lines ) and then followed by 10 status lines showing either Compelte or Failed. This pattern repeats several time. We can assume all the status lines have either Complete or Failed status for that Cache Group line. I... (13 Replies)
Discussion started by: MKNENI
13 Replies

6. Shell Programming and Scripting

Output of echo $$ differs in Script than console

Hi All, I have a very basic query for 'echo $$' command. When I am executing echo $$ on console then it is giving different output than the execution of echo $$ in a script. Console Output: ------------------------- bash-3.2$ echo $$ 15610 bash-3.2$ In Script:... (3 Replies)
Discussion started by: manishdivs
3 Replies

7. Shell Programming and Scripting

Tailing last modified part of log file

I have a log file which contains data like this This log file is updated twice a day at 7am and 6pm, I want a script(which i will make run at 7:10am and 6:10pm) which should fetch only the last appended lines since last update.. I mean.. if i execute the script at 7.10am 3/3/2010 it... (4 Replies)
Discussion started by: user__user3110
4 Replies

8. Shell Programming and Scripting

Tailing 2 or more log files simultaneously PERL

Hi, I am having issue where I have to tail 3 log files continuously (forever) and while I am reading the files , parse them and shove the data into DB. I can do this with one file totally fine but how can I read 3 files at the same time? I am not really looking for code (but would be nice) but... (3 Replies)
Discussion started by: Dabheeruz
3 Replies

9. Shell Programming and Scripting

How do I search first&second string & copy all content between them to other file?

Hi All, How do I search first string & second string and copy all content between them from one file to another file? Please help me.. Thanks In Advance. Regards, Pankaj (12 Replies)
Discussion started by: pankajp
12 Replies

10. UNIX for Dummies Questions & Answers

Writing to a file without echo it to the console !!!!

hi all, I am trying to write some message to a file using the following command. echo "${MESSAGE}" >&1 | tee -a ${File_name} can the same be done without using echo . I don't want the result to be displayed to the console. Can anyone guide me. Thanks in advance (6 Replies)
Discussion started by: amit_kv1983
6 Replies
Login or Register to Ask a Question
GEMS-SERVER(1)							gems documentation						    GEMS-SERVER(1)

NAME
gems-server - Transmit a shell session in real time. SYNOPSIS
gems-server [-ip ip] [-port p] [-maxconn n] [-wait m] [-log dest] [-noscript] [-script_bin script] gems-server -h | -v DESCRIPTION
Transmits a shell session to be shown in real time in various different computers or terminals. gems-server transmits data in real time to clients via a network connection. Each one of these clients must run the gems-client(1) program to establish connection and receive the transmitted data. Clients can connect and disconnect at any given time, but of course they will only receive the data that is transmitted while they are connected (just like a radio transmission/reception system). The gems system is normally used to transmit a console session and show it in various computers at the same time, but it is also possible to transmit any other kind of data. OPTIONS
-ip IP address where connections will be accepted. -port TCP port. Default: 6666. -maxconn Do not accept more than n simultaneous clients. Default: 25. -wait Wait until m clients are connected before starting the transmission. This is useful to ensure that the first m clients will receive all data transmitted. The default behavior is to start transmission immediately, without waiting for client connections. -log By default, the server does not write log messages. This option configures the destination of logs. The dest argument can be `sys- log' (to log through syslogd(8)), `stderr' (to log through standard error output), or it can be an arbitrary filename (log messages will be appended to the file, if it exists). -noscript By default, the server executes the script(1) program to take terminal data and transmit it. When this option is used the server will not run script, and data will be read form standard input. -script_bin Specifies the location of the script(1). program. Default: /usr/bin/script. -h Show a short help message. -v Show version information. FILES
/var/lock/gems-server.PORT Lock file. gems-server creates this file on initialization and deletes it on exit. PORT is replaced by the TCP port used. gems- server will not run if this file is already present in the system. AUTHORS
Diego Essaya <dessaya@fi.uba.ar> Emiliano Castagnari <ecastag@fi.uba.ar> SEE ALSO
gems-client(1), script(1), syslogd(8) gems AUGUST 2004 GEMS-SERVER(1)