Sponsored Content
Top Forums Shell Programming and Scripting Tailing new log file & echo the string on console Post 302391486 by raghunsi on Monday 1st of February 2010 01:12:03 PM
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...
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
smcwebserver(1M)					  System Administration Commands					  smcwebserver(1M)

NAME
smcwebserver - manage the server for the Sun Web Console SYNOPSIS
/usr/sbin/smcwebserver subcommand options DESCRIPTION
The smcwebserver utility manages the Sun Web Console server. Sun Web Console is a browser-based interface that performs systems management. System administrators can manage systems, devices and services from the console. When the console webserver is running, you can view the console by opening a browser and pointing to: https://host:6789 host is the machine where the console has been installed and the console server is running. SUBCOMMANDS
The following subcommands are supported: disable Disable automatic start or stop during system boot or shutdown. Until the administrator reruns the script with the smcweb- server enable subcommand the webserver can be started/stopped only when the administrator executes the script manually using the following command: # /usr/sbin/smcwebserver [start | stop] enable Enable the webserver to startup automatically during subsequent system boot and gracefully stop during system shutdown. restart Stop and subsequently start the console webserver. The format of the restart subcommand is: restart [-U username] start Start the console webserver. The format of the start subcommand is: start [-U username] stop Stop the console webserver. status Display status of the console webserver. The format of the status subcommand is: status [-p] OPTIONS
The following options are supported: -U username | --username usernamThe user identity to run the server as. Once the server has successfuly started under the specified iden- tity, all subsequent starts will automatically be done under that identity until you change it via this option, or by changing the com.sun.web.console.user configuration property via the smreg(1M) command. The default is to run the server under the "noaccess" identity. -p | --parseable Display non-localized output suitable for programmatic parsing. If the server is running, the output will be: running=yes If the server is not running, the output will be: running=no -h | --help | -? Display the usage statement. -V | --version Display console version information. EXAMPLES
Example 1: Displaying the Usage Statement The following command displays the smcwebserver usage statement: % smcwebserver --help Example 2: Determining if the Server is Running The following shell command will start the server if it is not already running. ans=`smcwebserver -p | grep running | cut -d"=" -f2` if [ "$ans" = "no" ]; then smcwebserver start fi ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of smcwebserver: JAVA_HOME If you do not specify this environment variable, your PATH is searched for a suitable java. Otherwise, depending on the OS, the follow- ing default locations are used: Solaris: /usr/j2se Linux: /usr/java/j2sdk1.4* EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWmcon | +-----------------------------+-----------------------------+ SEE ALSO
smreg(1M), attributes(5), environ(5) SunOS 5.10 27 May 2004 smcwebserver(1M)
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy