On Sat, 06 Sep 2008 16:01:08 +0100, brian54321uk wrote:
> Just tried this, nothing happened at all.
Really.
$ echo abc > /tmp/bar/one
$ echo xyz > /tmp/bar/two
$ echo ab..yz > /tmp/bar/three
$ ls /tmp/bar
one three two
$ cat /tmp/foo
#!/usr/bin/perl
use strict;
use warnings;
sub delete_contain
Here's another way, but not necessarily the best Perl, but it does work:
#!/usr/bin/env perl
use strict;
use warnings;
my @filelist=;
chomp @filelist;
my $match_strings=qr '(abc123blue|xyz357green)';
my ($file, );
foreach $file (@filelist) {
#print "file=$file\n";
open(FD,"<$file") or die "Cann
[EMAIL PROTECTED] wrote:
Here's another way, but not necessarily the best Perl, but it does work:
#!/usr/bin/env perl
use strict;
use warnings;
my @filelist=;
chomp @filelist;
my $match_strings=qr '(abc123blue|xyz357green)';
my ($file, );
foreach $file (@filelist) {
#print "file=$file\n";
Is
Peter Scott wrote:
On Fri, 05 Sep 2008 19:09:25 +0100, brian54321uk wrote:
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
One way:
use strict;
use warnings;
s
On Fri, 05 Sep 2008 19:09:25 +0100, brian54321uk wrote:
> I would like to test a folder full of files, and if a file contains
> abc123blue or xyz357green then that file is to be deleted.
> What would be the best way of achieving this please?
One way:
use strict;
use warnings;
sub delete_contain
Aruna Goke wrote:
brian54321uk wrote:
Aruna Goke wrote:
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the
John W. Krahn wrote:
Dr.Ruud wrote:
brian54321uk schreef:
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
I would use `grep -l` to get the list of filenames, an
John W. Krahn wrote:
Aruna Goke wrote:
brian54321uk wrote:
Aruna Goke wrote:
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file
contains abc123blue or xyz357green then that file is to be delete
Aruna Goke wrote:
brian54321uk wrote:
Aruna Goke wrote:
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the
Dr.Ruud wrote:
brian54321uk schreef:
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
I would use `grep -l` to get the list of filenames, and rm to unlink
them.
N
brian54321uk schreef:
> I would like to test a folder full of files, and if a file contains
> abc123blue or xyz357green then that file is to be deleted.
> What would be the best way of achieving this please?
I would use `grep -l` to get the list of filenames, and rm to unlink
them.
No Perl involv
brian54321uk wrote:
Aruna Goke wrote:
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achievi
Mr. Shawn H. Corey wrote:
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
HI again
I would like to test a folder full of files, and if a file contains
abc123blue or xyz357green then that file is to be deleted.
What would be the best way of achieving this please?
If however, it would be
2008/9/6 Raja Vadlamudi <[EMAIL PROTECTED]>:
>
> for (glob("folder/*")) {
> unlink if m/abc123blue|xyz357green/;
> }
>
This would also delete "abc123blue.exe", "abc123blue.txt",
"otherabc123blue" etc.
OP could consider to use File::Find to do that.
--
Regards,
Jeff.
--
To unsubscribe, e-mai
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote:
> HI again
> I would like to test a folder full of files, and if a file contains
> abc123blue or xyz357green then that file is to be deleted.
> What would be the best way of achieving this please?
>
> If however, it would be simpler for the s
On Fri, Sep 5, 2008 at 2:09 PM, brian54321uk <[EMAIL PROTECTED]>wrote:
> HI again
> I would like to test a folder full of files, and if a file contains
> abc123blue or xyz357green then that file is to be deleted.
> What would be the best way of achieving this please?
>
> If however, it would be si
> I need to delete files older than one week old,
> I know how to code that(with the help of many kind people on
> this list):
Here is a single command that will blow files older than 48 hours away
from given directory. You can put as many of these in a single sh script
as you want
Hi, ZHAO,
If your system is Unix or similar, you can use cron (See cron). If Windows,
you can use task manager
José Pinto
-Original Message-
From: ZHAO, BING [mailto:[EMAIL PROTECTED]
Sent: domingo, 23 de Outubro de 2005 7:28
Cc: beginners@perl.org
Subject: delete file after on week
ZHAO, BING wrote:
Hi:
I need to delete files older than one week old, I know how
to code that(with the help of many kind people on this list):
But it only happens when I run the program, there is a
chance I will not be running the program for more than a week. And the
d
try unlink . example: unlink $file;
On Fri, 11 Jul 2003, Boon Chong Ang wrote:
> Hi,
>
> My name is Boon Chong. I have question. Just say, I run a perl script
> and in between of the process I create a temporarily file for checking
> purpose. Now, how do I ask perl to delete the file automatically
Boon Chong Ang wrote:
>
> Hi,
Hello,
> My name is Boon Chong. I have question. Just say, I run a perl script
> and in between of the process I create a temporarily file for checking
> purpose. Now, how do I ask perl to delete the file automatically?
Use IO::File::new_tmpfile()
perldoc IO::Fil
Boon Chong Ang wrote:
Hi,
My name is Boon Chong. I have question. Just say, I run a perl script
and in between of the process I create a temporarily file for checking
purpose. Now, how do I ask perl to delete the file automatically?
Automatically as in, when the script finished executing?
Use t
perl -f unlink
http://www.perldoc.com/perl5.8.0/pod/func/unlink.html
José.
> -Original Message-
> From: Boon Chong Ang [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 11, 2003 10:13 AM
> To: [EMAIL PROTECTED]
> Subject: delete file
>
>
> Hi,
>
> My name is Boon Chong. I have question.
Something like this:
while ( 1 ) {
printf "Please enter file to delete:";
chomp(my $filetodelete = );
last if ( $filetodelete =~ /^exit$/i );
printf "Deleting file: %-s\n", $filetodelete;
while ( 1 ) {
printf "Do you want to delete?: ";
chomp(
Command line or html ?
Unix or windows?
-Original Message-
From: Jakob Kofoed [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: delete file
Hi,
How can I delete a file in a script - but get the script to ask me if I really want to
del
25 matches
Mail list logo