Re: Writing my first perl script

2005-05-06 Thread Offer Kaye
On 5/6/05, macromedia wrote: > > Hello, > > I'm not sure about the login or how I should approach what I want to > achieve. I require a script that does the following. > > 1. Search a directory and all sub-directories for a certain file > extension. (Ex. .txt) > > 2. Get the results of the abov

Re: Writing my first perl script

2005-05-06 Thread Michael Gale
Hello, A bash script would be a better choice for this particular request. #!/bin/bash find . -type f -name "*.txt" -print | xargs grep -l 123 >> externalfile The above command would search the current directory plus all sub- directories for all files the end in a ".txt" and search each

RE: Writing my first perl script

2005-05-06 Thread macromedia
mpilation errors. -Original Message----- From: Gavin Henry [mailto:[EMAIL PROTECTED] Sent: Friday, May 06, 2005 12:24 PM To: beginners@perl.org Subject: Re: Writing my first perl script On Friday 06 May 2005 16:50, macromedia wrote: > Something like this? > > #!/usr/bin/perl -w >

Re: Writing my first perl script

2005-05-06 Thread Gavin Henry
essage- > From: Gavin Henry [mailto:[EMAIL PROTECTED] > Sent: Friday, May 06, 2005 11:24 AM > To: beginners@perl.org > Subject: Re: Writing my first perl script > > > > > Hello, > > > > I'm not sure about the login or how I should approach what I want to >

RE: Writing my first perl script

2005-05-06 Thread macromedia
ile () { if ($line =~ /$num/ { print $line; } } close FILE; } -Original Message- From: Gavin Henry [mailto:[EMAIL PROTECTED] Sent: Friday, May 06, 2005 11:24 AM To: beginners@perl.org Subject: Re: Writing my first perl script > > Hello, > > I'm n

Re: Writing my first perl script

2005-05-06 Thread Gavin Henry
> > Hello, > > I'm not sure about the login or how I should approach what I want to > achieve. I require a script that does the following. Here are the quick answer, which provide you some reading material: > > 1. Search a directory and all sub-directories for a certain file > extension. (Ex. .t

Writing my first perl script

2005-05-06 Thread macromedia
Hello, I'm not sure about the login or how I should approach what I want to achieve. I require a script that does the following. 1. Search a directory and all sub-directories for a certain file extension. (Ex. .txt) 2. Get the results of the above search and check "inside" each file for a strin

Re: My first perl script

2004-07-12 Thread John W . Krahn
On Monday 12 July 2004 01:47, Paul Smith wrote: > > Thanks, Gunnar. I understand your point of view. Meanwhile, John > Krahn has kindly provided a solution for my problem, which I very > much thank. However, to convince you that I was trying to solve the > problem by myself, I quote below the scrip

Re: My first perl script

2004-07-12 Thread Paul Smith
(Please, be patient with my ignorance.) I for one am, don't worry. But I'm *not* patient with suspected laziness. ;-) I'd like to see you post some code, where you show us that you are seriously trying to learn, and where you have at least tried to solve this new problem. Thanks, Gunnar. I understa

Re: My first perl script

2004-07-12 Thread Gunnar Hjalmarsson
Paul Smith wrote: Thanks, John and Gunnar. You're welcome. (Please, be patient with my ignorance.) I for one am, don't worry. But I'm *not* patient with suspected laziness. ;-) I'd like to see you post some code, where you show us that you are seriously trying to learn, and where you have at least

Re: My first perl script

2004-07-11 Thread John W . Krahn
On Sunday 11 July 2004 14:12, Paul Smith wrote: > > John W.Krahn wrote: > > > > #!/usr/bin/perl > > use warnings; > > use strict; > > > > ( $^I, @ARGV ) = ( '.bak', 'text_file' ); > > while ( <> ) { > > s/^#// if /Zyloric/; > > print; > > } > b> Thanks, John and Gunnar. (Please, be pati

Re: My first perl script

2004-07-11 Thread Gunnar Hjalmarsson
Paul Smith wrote: I am a beginner with perl. I would like to ask you whether it is difficult to make a perl script doing the following: (1) read a text file; (2) erase the character # placed at the beginning of the line that contains "Zyloric"; (3) replace the original file with the file got aft

Re: My first perl script

2004-07-11 Thread John W . Krahn
On Sunday 11 July 2004 10:18, Paul Smith wrote: > > Dear All Hello, > I am a beginner with perl. I would like to ask you whether it is > difficult to make a perl script doing the following: > > (1) read a text file; > (2) erase the character # placed at the beginning of the line that > contains "

My first perl script

2004-07-11 Thread Paul Smith
Dear All I am a beginner with perl. I would like to ask you whether it is difficult to make a perl script doing the following: (1) read a text file; (2) erase the character # placed at the beginning of the line that contains "Zyloric"; (3) replace the original file with the file got after the de