LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-13-2003, 08:57 AM   #1
letmein
LQ Newbie
 
Registered: Jul 2003
Posts: 24

Rep: Reputation: 15
Some help with Perl !!!


hi ...

I have a FIFO o/p which looks something like this.

134.88.146.205 USER "USER test1" -
134.88.146.205 PASS "PASS (hidden)" -
134.88.146.205 SYST "SYST" -
134.88.146.205 FEAT "FEAT" -
222.21.675.123 PWD "PWD" -
222.21.675.123 TYPE "TYPE A" -
134.88.146.205 PORT "PORT 134,88,146,205,5,46" -
134.88.146.205 LIST "LIST" -
222.21.675.123 CWD myfiles "CWD myfiles" -
222.21.675.123PWD "PWD" -
222.21.675.123 PORT "PORT 134,88,146,205,5,47" -
222.21.675.123 LIST "LIST" -
134.88.146.205 CWD ghome "CWD ghome" -
134.88.146.205 PWD "PWD" -
134.88.146.205 PORT "PORT 134,88,146,205,5,48" -
134.88.146.205 LIST "LIST" -
222.21.675.123 CWD songs "CWD songs" -
222.21.675.123 PWD "PWD" -
134.88.146.205 PORT "PORT 134,88,146,205,5,49" -


Now what i want to do is restrict only the lines which have the IP address "134.88.147.205" and ignore the rest of the lines of the FIFO o/p with different IP's. And I want to do that dynamically ar run time.

can any body help me .
Thanks in advance
 
Old 08-13-2003, 09:00 AM   #2
letmein
LQ Newbie
 
Registered: Jul 2003
Posts: 24

Original Poster
Rep: Reputation: 15
Some help with perl ....

did i mention i am using perl?
 
Old 08-13-2003, 09:37 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
care to explain this a little more... this is a text sting you are parsing using perl? in which case you'd just use a standard regex ...

Code:
while (<>) {
    print  if /134\.88\.147\.205/
}
is that what you mean?
 
Old 08-13-2003, 11:05 AM   #4
letmein
LQ Newbie
 
Registered: Jul 2003
Posts: 24

Original Poster
Rep: Reputation: 15
its not a text file its an o/p of a FIFO !!!
 
Old 08-13-2003, 12:17 PM   #5
quest4knowledge
Member
 
Registered: Aug 2003
Distribution: gentoo
Posts: 62

Rep: Reputation: 15
Not sure if this helps or not. But why not just limit the ability to connect to the service with iptables or something similar?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 05:37 PM
cgi perl : I cant get perl to append my html file... the_y_man Programming 3 03-22-2004 05:07 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
chrooting apache v2 (php, ssl, perl support) ; perl configuration markus1982 Linux - Security 3 01-26-2003 06:15 PM
can i set ~/public_html/perl as a perl directory for apache? doublefailure Linux - Networking 1 07-09-2002 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration