Re: read the time from last line of a file in unix

2008-09-09 Thread John W. Krahn
Rodrick Brown wrote: On Tue, Sep 9, 2008 at 3:23 PM, <[EMAIL PROTECTED]> wrote: i want get the time specified in last line of the file. For eg: $tail -2 test.log 2008 aug 25 14:48:42.800 Sending ping message; 2008 aug 25 14:48:43.390 Sending ping message; The file size is huge, so i dont want

Re: read the time from last line of a file in unix

2008-09-09 Thread Rodrick Brown
On Tue, Sep 9, 2008 at 3:23 PM, <[EMAIL PROTECTED]> wrote: > Hi All, > > i want get the time specified in last line of the file. > For eg: > $tail -2 test.log > 2008 aug 25 14:48:42.800 Sending ping message; > 2008 aug 25 14:48:43.390 Sending ping message; > The file size is huge, so i dont want t

Re: capturing output from a program that prompts for input

2008-09-09 Thread Mr. Shawn H. Corey
On Tue, 2008-09-09 at 14:04 -0700, doubleHelix wrote: > I am having a problem in capturing the output and exit value from a > system command that prompts the user for input. The following shows a > simplification of the problem. Im trying to get it so that all the > text before the prompt gets outp

Re: read the time from last line of a file in unix

2008-09-09 Thread Mr. Shawn H. Corey
On Tue, 2008-09-09 at 12:23 -0700, [EMAIL PROTECTED] wrote: > Hi All, > > i want get the time specified in last line of the file. > For eg: > $tail -2 test.log > 2008 aug 25 14:48:42.800 Sending ping message; > 2008 aug 25 14:48:43.390 Sending ping message; > The file size is huge, so i dont want

Re: capturing output from a program that prompts for input

2008-09-09 Thread Raymond Wan
Hi, Seems like what you need is to do an "autoflush". Try searching for it with Google...this might be a good start and enough for what you want: http://bytes.com/forum/thread603712.html Note that stdout tends to be buffered and stderr not (since it's for error messages and they should app

Re: read the time from last line of a file in unix

2008-09-09 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi All, Hello, i want get the time specified in last line of the file. For eg: $tail -2 test.log 2008 aug 25 14:48:42.800 Sending ping message; 2008 aug 25 14:48:43.390 Sending ping message; The file size is huge, so i dont want to read the entire file to get the last

Re: Regexp in PERL

2008-09-09 Thread John W. Krahn
anders wrote: Hi i have som text with " and space and then a numbers eg. " 234234 I tested to write $line =~ s/\" [0-9]/[0-9]/g; I like it to change " 234 to "234 But it made "[0-9] Anyone how should i have write to tell it to find and convert corrent. $line =~ s/(?<=") +(?=[0-9])//g;

Re: read the time from last line of a file in unix

2008-09-09 Thread Jeff Pang
2008/9/10 <[EMAIL PROTECTED]>: > Hi All, > > i want get the time specified in last line of the file. > For eg: > $tail -2 test.log > 2008 aug 25 14:48:42.800 Sending ping message; > 2008 aug 25 14:48:43.390 Sending ping message; > The file size is huge, so i dont want to read the entire file to ge

Re: Regexp in PERL

2008-09-09 Thread Jeff Pang
2008/9/10 anders <[EMAIL PROTECTED]>: > Hi i have som text with " and space and then a numbers > eg. > " 234234 > > I tested to write > $line =~ s/\" [0-9]/[0-9]/g; > > I like it to change > " 234 to "234 > If you just want to remove the space between " and numbers, try: $line =~ s/\s+//; --

Regexp in PERL

2008-09-09 Thread anders
Hi i have som text with " and space and then a numbers eg. " 234234 I tested to write $line =~ s/\" [0-9]/[0-9]/g; I like it to change " 234 to "234 But it made "[0-9] Anyone how should i have write to tell it to find and convert corrent. Best regards Anders -- To unsubscribe, e-mail: [

capturing output from a program that prompts for input

2008-09-09 Thread doubleHelix
I am having a problem in capturing the output and exit value from a system command that prompts the user for input. The following shows a simplification of the problem. Im trying to get it so that all the text before the prompt gets output before the script gets stuck at the prompt. I’m sure it is

read the time from last line of a file in unix

2008-09-09 Thread devika84
Hi All, i want get the time specified in last line of the file. For eg: $tail -2 test.log 2008 aug 25 14:48:42.800 Sending ping message; 2008 aug 25 14:48:43.390 Sending ping message; The file size is huge, so i dont want to read the entire file to get the last line. Is there any way to get the la

Supress the N or Y question prompted by a Perl module, or automate an answer.

2008-09-09 Thread bdy
I'm running a perl command from a DOS command line, and I am sometimes prompted to either discard a file I'm downloading or truncate and save it. How do I suppress the prompt and tell the .bat to always answer "N"? Would it be similar to the suppression command in copy in DOS, that is / N or /-N, o

Re: using ssh to do remote audit of machines

2008-09-09 Thread Gregory Machin
Thanks will look into those . On Tue, Sep 9, 2008 at 10:07 AM, Jeff Pang <[EMAIL PROTECTED]> wrote: > 2008/9/9 Gregory Machin <[EMAIL PROTECTED]>: >> Hi >> I have a database with my servers details in .. I would like to write >> a scripts to get the servers log on info ssh to the box and get basic

Re: using ssh to do remote audit of machines

2008-09-09 Thread Jeff Pang
2008/9/9 Gregory Machin <[EMAIL PROTECTED]>: > Hi > I have a database with my servers details in .. I would like to write > a scripts to get the servers log on info ssh to the box and get basic > info using the following > > hostname > cat /etc/issue > cat /proc/cpuinfo | grep "model name" > cat /p

using ssh to do remote audit of machines

2008-09-09 Thread Gregory Machin
Hi I have a database with my servers details in .. I would like to write a scripts to get the servers log on info ssh to the box and get basic info using the following hostname cat /etc/issue cat /proc/cpuinfo | grep "model name" cat /proc/meminfo | grep "MemTotal" uname -s -r squid -v /usr/sbin/s