New to perl

G

Gus

What would the syntax be for the follwing?

I want to cat /admin/log/fileA, and grep any lines that have the name
"joe", then send the output to /admin/log/fileB. Then I want to view
/admin/log/fileB

I want to cat /admin/log/fileA, and grep any lines that have today's
dat in them, then send that output to /admin/log/fileC. Then I want to
view that file.

New to perl ... thanks for the help.

Thanks!
 
D

David K. Wall

I want to cat /admin/log/fileA, and grep any lines that have the
name "joe", then send the output to /admin/log/fileB. Then I want
to view /admin/log/fileB

Why use Perl for this when you have other tools to make it easy?

grep "joe" /admin/log/fileA | tee /admin/log/fileB | less

I don't know why you need to save the grepped stuff to fileB, but tee
will do it.
 
C

Chris Mattern

David said:
Why use Perl for this when you have other tools to make it easy?

grep "joe" /admin/log/fileA | tee /admin/log/fileB | less

I don't know why you need to save the grepped stuff to fileB, but tee
will do it.

It's September. I smell homework.
--
Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
 
J

Jürgen Exner

Gus said:
What would the syntax be for the follwing?

I want to cat /admin/log/fileA,

I don't think so. Maybe you meant to say you want to read /admin/log/fileA?
If yes, then please see
perldoc -f open
including the examples.
If no, then you should ask in a group that deals with the tool "cat".
and grep any lines that have the name
"joe",

perldoc -f grep
then send the output to /admin/log/fileB.

perldoc -f open
perldoc -f print
Then I want to view
/admin/log/fileB

perldoc -f open
perldoc -f print
I want to cat /admin/log/fileA, and grep any lines that have today's
dat in them, then send that output to /admin/log/fileC. Then I want to
view that file.

Only new item in this list would be
perldoc -f time
perldoc -f localtime

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,882
Members
47,419
Latest member
ArturoBres

Latest Threads

Top