The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl Scripting agarwal Shell Programming and Scripting 3 04-30-2008 09:12 AM
Perl Scripting.. Kingkon Shell Programming and Scripting 4 03-06-2008 07:31 PM
Perl scripting rsendhilmani Shell Programming and Scripting 3 07-04-2007 11:51 PM
Perl Scripting vaibhav Shell Programming and Scripting 10 03-27-2007 02:32 AM
Perl scripting rochitsharma UNIX for Advanced & Expert Users 2 08-24-2006 04:55 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-06-2002
Registered User
 

Join Date: May 2002
Posts: 7
Perl scripting

Can anyone help .....
I am prettey new to perl but would like to do the following :- write a script that would open one or more log files and select a few lines from each and create a new file with the selected lines from the logs.
Thanx
Forum Sponsor
  #2  
Old 05-07-2002
Registered User
 

Join Date: May 2002
Location: that depends on which router I bounce off...
Posts: 1
edited post

[Snipped by LivinFree]
Crawler - that was innapropriate.

It was counter-productive and a waste of time.

"A little knowledge is a scary thing"
__________________
.....::: the crawler:::.....

Last edited by LivinFree; 05-10-2002 at 09:45 PM.
  #3  
Old 05-09-2002
dsb dsb is offline
Registered User
 

Join Date: May 2002
Location: NJ
Posts: 2
Okay, what have you got so far? Let's see some code?

Being new to Perl does not get free scripts for you. People know how to do that because they learned Perl.

Here's a hint though:
Code:
prompt$ perldoc -f open
or
Code:
prompt$ perldoc FileHandle
__________________
- dsb -
Perl Guy
  #4  
Old 05-10-2002
boris888
Guest
 

Posts: n/a
Re: kiddie...

Quote:
Originally posted by crawler
Serious... take a look at your question again. What you're really asking is for someone to script something for you. That, buddy, is LAME. So my suggestion is... goto the library, borrow a book called "Learning Perl" by Randal L. Schwartz and Tom Christiansen (ISBN 1-5692-284-0) and <b>Learn</b> it. Then, you can script the program that you wanted yourself.

#!usr/bin/perl
while (<>){
print "...japh...";
}
ur calling him lame? what's up with the <b> , </b>? just kidding! no offence, i just like to deflate bubles. you don't have to do the script for him, just give examples! think of it as a compliment that he seeks out your vast wisdom!
  #5  
Old 05-20-2002
Registered User
 

Join Date: May 2002
Location: New Jersey
Posts: 1
Red face Perl Script - Reading log files

Basically you will need to load the log file entirely into an array, or line by line because you are looking to separate items. The file system of perl in not very efficient, but nonetheless, what you ask for is VERY easy, VERY common and VERY obvious in the books, texts and examples. If you get stuck, let me know, happy to TEACH but not DO IT FOR YOU......

Depending on your OS, you may NOT be able to follow some of the former advice, or, it may be to your advantage, again, this depends on your os, not perl..... i.e. OSX, AIX, UNIX5,WIN2K,Linux,DOS, and also how your server is set up, is this under an Apache or IIS server or all by it's lonesome...

Nytok
__________________
Nytok
Arrow Mountain International
Software Development
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0