TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:8884] converting uppercase to lowercase




First of all, get rid of the pipe.  The following syntax should work.

find . -depth -exec mklc {} \;

I'm only a novice at Perl, but @ARGV looks to be a array of all the
arguments passed to the mklc program.  It doesn't reference STDIN.

--
Carl Patten
Systems Administrator
Trimodal Inc.

> -----Original Message-----
> From: Carl Wilhelm Soderstrom [mailto:carls@agritech.com]
> Sent: Friday, October 01, 1999 3:16 PM
> To: tclug-list@mn-linux.org
> Subject: [TCLUG:8884] converting uppercase to lowercase
>
>
>         I have a directory tree full of files; the filenames are all in
> uppercase.
>         I wish all the filenames to be lowercase
>         I have a perl script (named mklc) that will convert uppercase to
> lowercase filenames:
>
> #!/usr/bin/perl
> foreach $filename(@ARGV)

>         $newfilename = lc($filename);
>         print "$filename -> $newfilename\n";
>         rename ($filename, $newfilename);
>         }
>
>         how do I make it recurse the entire tree, tho; and convert the
> filenames?
>         I tried 'find . -depth| mklc ' and 'find . -depth| mklc * ' but it
> gives me a 'broken pipe' error both times. so obviously the output is not
> getting from 'find' to 'mklc'.
>         I don't know perl very well (the script was written with
> the help of
> ppl on this list); and I forget what the '(@ARGV)' means. I think it's an
> array made from stdin; but don't really have a clue.
>
>         where am I going wrong?
>
> Carl Soderstrom
> System Administrator	307 Brighton Ave.
> Minnesota DHIA		Buffalo, MN
> carls@agritech.com	(612) 682-1091
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
>