RE: array and hash patter matching

2007-05-08 Thread Tim Wolak
John, Below are ansewers to your questions. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Monday, May 07, 2007 12:57 PM To: Perl Beginners Subject: Re: array and hash patter matching Tim Wolak wrote: > Morning all, Hello, > I am working on a script that

array and hash patter matching

2007-05-07 Thread Tim Wolak
Morning all, I am working on a script that reads in /var/log/auth.log,, takes the ip addresses puts them into a hash keeping track of how many times it finds that address and compare it to addresses found in /etc/hosts.deny and only write the addresses that are new in the file. So far I can get t

RE: two questions

2006-11-13 Thread Tim Wolak
PROTECTED] Sent: Monday, November 13, 2006 10:23 AM To: Tim Wolak; beginners@perl.org Subject: Re: two questions On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote: > I have changed it to: > > if ($grp =~ /E\$/) { > $grp = "E\$"; > } > This h

RE: two questions

2006-11-13 Thread Tim Wolak
AIL PROTECTED] Sent: Monday, November 13, 2006 9:58 AM To: Tim Wolak; beginners@perl.org Subject: Re: two questions On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote: > Can anyone tell me why when matching E$ option it finds ZE instead? $ is special in regexps. Used like that /(E$)/, it m

two questions

2006-11-13 Thread Tim Wolak
Can anyone tell me why when matching E$ option it finds ZE instead? What I have is a script that looks at a file from an exchange, parses each line looking for specific products, i.e. E$, ZE, GE etc. Fro some reason when I ask the file to single out E$ it brings back all the matches for ZE, all th

code issue

2006-11-08 Thread Tim Wolak
All, I have been working on this script to extract information based on group selection, being E0, GE, E5. This works fine however I am testing the selection to see if E$ is entered and it so escape the $ in the process. Am I missing something because it never finds E$ in any of the files I'm par

RE: line position

2006-11-03 Thread Tim Wolak
Thanks David, that is exactly what I did just before receiving your email! Thanks for the help! Tim -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, November 03, 2006 3:17 PM To: Tim Wolak; beginners@perl.org Subject

RE: line position

2006-11-03 Thread Tim Wolak
er 03, 2006 12:49 PM To: Tim Wolak; beginners@perl.org Cc: Wagner, David --- Senior Programmer Analyst --- WGO Subject: RE: line position So what makes up a line? CME through the next CME? You can concatenate all the data together if desired( do a chomp first) and check if CME or What denote

RE: line position

2006-11-03 Thread Tim Wolak
03BIO 0102000500201E00 000 -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, November 03, 2006 12:16 PM To: Tim Wolak; beginners@perl.org Subject: RE: line position If you provide some data a

line position

2006-11-03 Thread Tim Wolak
All, I need to parse lines from a file and at a certain position test to see if it is what a want, if so I need to grab information from other positions in the line and drop it into a file. As I have never done this before, can someone point me in the right direction as to get started? Thanks fo

date and file comparison

2006-11-03 Thread Tim Wolak
Morning all, I need to compare the current date with that of a file, if the file is older than the current date remove it and replace it with a new one from new data. Below I have the code set for getting the date but can't come up with an easy way to compare it against the file date. Can anyone

RE: logfile rotation

2006-10-13 Thread Tim Wolak
I want them rotated but marked with dates in their file names, instead of file.1, file.2 etc. Tim On Fri, 2006-10-13 at 14:35 +0200, Thomas Bätzler wrote: > Tim Wolak <[EMAIL PROTECTED]> asked: > > I'm working on rotating log files and am using the > > logfile::rota

logfile rotation

2006-10-13 Thread Tim Wolak
Hi all, I'm working on rotating log files and am using the logfile::rotate module. What I need to do is add the date to the file name that is being created. Would I use the post function and move the file and append it to the file? If so could you proved an example? Thanks, Tim #!/usr/bin/pe

log rotation

2006-10-12 Thread Tim Wolak
Hi all, I'm working on rotating log files and am using the logfile::rotate module. What I need to do is add the date to the file name that is being created. Would I use the post function and move the file and append it to the file? If so could you proved an example? Thanks, Tim #!/usr/bin/pe

dates

2006-10-10 Thread Tim Wolak
Just a quick easy one, while printing localtime, how do I get it to print the full minutes and seconds, i.e. :02?? Thanks, Tim my $date; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime) [0,1,2,3,4,5]; $year=$year+1900; $mon=$mon+1; $date = sprintf("%02d%02d%02d\_$hour\:$min\:$sec", $year,$mon,

Re: smash and grab

2006-08-04 Thread Tim Wolak
On Fri, 2006-08-04 at 14:46 +0200, D. Bolliger wrote: > Tim Wolak am Freitag, 4. August 2006 14:07: > > Hello Tim > > > On Thu, 2006-08-03 at 15:26 -0700, John W. Krahn wrote: > > > Rob Dixon wrote: > > > > Tim Wolak wrote: > > > >>

Re: smash and grab

2006-08-04 Thread Tim Wolak
On Thu, 2006-08-03 at 15:26 -0700, John W. Krahn wrote: > Rob Dixon wrote: > > > > Tim Wolak wrote: > >> > >> if($box =~ m/"$tim"/){ > > > > Do you intend the quotes? If the lines from the origin

smash and grab

2006-08-03 Thread Tim Wolak
Hi All, I'm working on a bit of code to parse a logfile, grab the IP's and put them in the deny file. In the beginning of my code I'm grabbing all the IP's in the deny file, putting them in an array to check against later to make sure that IP is not already in the file. I can get all the informa

match and grab

2006-08-02 Thread Tim Wolak
Hello all, I am writing a script to monitor a file and if a line is matched write it to a file, then grab the IP address from that line and write it to another file. As I'm ok on working with the files, I need a little help as to how to get the IP address out of the line of text into a variable f

Re: big pattern matching

2005-09-07 Thread Tim Wolak
Rightly so but I have a big script for removing entries in the registry and the files the virus inserts so I'd like to do it with the script to get it done in one pass. On 9/7/05, Chris Devers <[EMAIL PROTECTED]> wrote: > > On Wed, 7 Sep 2005, Tim Wolak wrote: > > >

big pattern matching

2005-09-07 Thread Tim Wolak
All, I need to clean up a host file from the worm that was out a couple weeks ago. I have done pattern matching but not this big before, can anyone offer some advice on how to clean this up. I do have some machines that have host entries in this file so I don't want to delete any of that inform

Tie::Registry

2005-08-30 Thread Tim Wolak
Guys thanks for the help yesterday. I have one more question, can someone have a look at my script and tell me why I'm not getting the value of the key? The prints are just to prove to me that its working... Thanks, Tim use strict; use warnings; use Win32::TieRegistry (Delimiter => '/'); my $pa

windows registry

2005-08-29 Thread Tim Wolak
All, This is my first attempt at using perl to work with a windows system and need some help. I need to check for some registry entries made by a virus and remove them. Which is the best module for this and do you know of any example code I can look at? Thanks for the help, Tim -- To unsubscri

Active Directory and Perl advice

2005-04-14 Thread Tim Wolak
Hi all, I am being asked to create a perl script to migrate AD accounts from one machine to another and also migrate their files and directory structure. Is there any good web sites I can take a look for some example scripts or any good books? Thanks in advance. Tim -- To unsubscribe, e-mail:

writting a detailed log

2005-03-04 Thread Tim Wolak
All, I am writtting this script for a client that will transfer their files via SFTP and write a small log to their system. I would also like it to write a log on our server as well, other than just doing what I have, writting the date and the file transfered. What can I do to capture erros f

SFTP cont.

2005-03-03 Thread Tim Wolak
Ok, thanks for your help so far, this is what I have now: use strict; use Net::SFTP; my $user = 'user1'; my $password = 'password'; my $host = "0.0.0.0"; my $sftp = Net::SFTP->new($host); $sftp->login($user,$password) or die "Can't connect... $!"; $sftp->put("test.txt"); However when I run it I get

SFTP

2005-03-03 Thread Tim Wolak
Hello all, This is my first attempt at writting a script for automating a sftp session and could use a little help. Can someone have a look at my script and give a me few pointers? I know I may be missing a few things but I have not worked a lot with modules yet so forgive the mistakes. Thank

checking for errors

2005-01-13 Thread Tim Wolak
Hello all, I have a script that is checking a service to see if its running and that its log file does not contain two error message to confirm that it has not died. However the subrutine is just saying its up when I have put the error message in the last line of the log to make sure it sees th

Dates

2005-01-06 Thread Tim Wolak
Hello all, I am in need of a quick way to get the current date in the MMDD format. This is something I would like to understand better on how to get the date with perl. Any suggestions would be most welcome. Tim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: