Scan disk for files with certain owner

2007-02-28 Thread Andreas Moroder
Hello, I need a perl script that runs under linux that should recursively search the directory tree and print out all the files that have a uid or gid that does not resolv to a username or userid. Can anyone give me a hint ? Thanks Andreas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Scan disk for files with certain owner

2007-02-28 Thread Neal Clark
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'd use some combination of File::Find with getgrgid and getpwuid with the wanted callback. #!/usr/bin/perl -w use strict; use File::Find; my @directories = ('/dir1','/dir2'); find(\&wanted,@directories); sub wanted { my ($dev, $ino, $

Re: Scan disk for files with certain owner

2007-02-28 Thread John W. Krahn
Andreas Moroder wrote: > Hello, Hello, > I need a perl script that runs under linux that should recursively > search the directory tree and print out all the files that have a uid or > gid that does not resolv to a username or userid. > > Can anyone give me a hint ? perl -e'exec qw[ find / -nou

remove line if field one is duplicate

2007-02-28 Thread Keenan, Greg John \(Greg\)** CTR **
Hi, I have to combine several Unix password files and remove any duplicate accounts - putting this into LDAP. I have the following code that will remove any duplicate whole lines but I need to remove lines only if the first field of the password file is a duplicate. - use str

Re: Scan disk for files with certain owner

2007-02-28 Thread Neal Clark
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 or perhaps more to the point my ($uid,$gid) = (lstat($_))[4..5]; On Feb 28, 2007, at 12:30 AM, Neal Clark wrote: sub wanted { my ($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_); -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.3 (Dar

Re: remove line if field one is duplicate

2007-02-28 Thread Jeff Pang
-Original Message- >From: "Keenan, Greg John (Greg)** CTR **" <[EMAIL PROTECTED]> >Sent: Feb 28, 2007 12:39 PM >To: beginners@perl.org >Subject: remove line if field one is duplicate > >Hi, > >I have to combine several Unix password files and remove any duplicate >accounts - putting this

Re: cgi calender

2007-02-28 Thread oryann9
--- Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 2/27/07, oryann9 <[EMAIL PROTECTED]> wrote: > > > Problem: cgi calender daynames are not matching up > > with dates. For example: Todays date 02/27/2007 is > > being printed under Thursday instead of Tuesday. > > Is the problem that you need to det

Characters from encryption

2007-02-28 Thread Ned Cunningham
Hi all. I have an issue with some characters passed back or read to a file. The character is a right arrow? When I read it I only get up to that character. The remaining characters are dropped. I have tried printing the string to a file, reading it in an array and so forth. When I

Re: remove line if field one is duplicate

2007-02-28 Thread Chas Owens
On 2/27/07, Keenan, Greg John (Greg)** CTR ** <[EMAIL PROTECTED]> wrote: Hi, I have to combine several Unix password files and remove any duplicate accounts - putting this into LDAP. I have the following code that will remove any duplicate whole lines but I need to remove lines only if the firs

Re: Characters from encryption

2007-02-28 Thread Chas Owens
On 2/28/07, Ned Cunningham <[EMAIL PROTECTED]> wrote: I have an issue with some characters passed back or read to a file. Without knowing what your code looks like, the ord value of the character, and what system you are running on (is EBCDIC, ascii, or some other character set?) it is doubtful

Re: Scan disk for files with certain owner

2007-02-28 Thread Andreas Moroder
Neal Clark schrieb: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'd use some combination of File::Find with getgrgid and getpwuid with the wanted callback. #!/usr/bin/perl -w use strict; use File::Find; my @directories = ('/dir1','/dir2'); find(\&wanted,@directories); sub wanted {

URL too long

2007-02-28 Thread Tatiana Lloret Iglesias
Hi all, i have to browse a very long URL from my PERL script and it fails: http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.html&r=0&p=1&f=S&l=50&Query=%28%22NRF3%22+AND+%22Colorectal+Cancer%22%29+OR+%28%22NRF3%22+AND+%22Colorectal+Carcinoma%22%

Re: URL too long

2007-02-28 Thread Igor Sutton Lopes
Hi Tatiana, On 2007/02/28, at 16:57, Tatiana Lloret Iglesias wrote: Hi all, i have to browse a very long URL from my PERL script and it fails: http://appft1.uspto.gov/netacgi/nph-Parser? Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch- adv.html&r=0&p=1&f=S&l=50&Query=%28%22NRF3%22+AND+

Re: URL too long

2007-02-28 Thread Beginner
I think GET request are restricted to 256 characters, try using POST instead. HTH, Dp. On 28 Feb 2007 at 18:57, Tatiana Lloret Iglesias wrote: > Hi all, > > i have to browse a very long URL from my PERL script and it fails: > > http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITO

Re: URL too long

2007-02-28 Thread Tom Phoenix
On 2/28/07, Tatiana Lloret Iglesias <[EMAIL PROTECTED]> wrote: i have to browse a very long URL from my PERL script and it fails: Do you know how to make it works?? Do you know that you have the correct URL? If so, you merely need to fix your code. Since you didn't include any code, I'll su

Re: URL too long

2007-02-28 Thread Tatiana Lloret Iglesias
Yes! that's the problem, GET method doesnt allow very very long url's ... how can I use POST from Perl code? do you have any example? Thanks! T On 2/28/07, Beginner <[EMAIL PROTECTED]> wrote: I think GET request are restricted to 256 characters, try using POST instead. HTH, Dp. On 28 Feb 2

Re: URL too long

2007-02-28 Thread Beginner
That depends on what your using, CGI or LWP. A CGI example might be $q->start_form(-method=>'POST'). Your need to check out the documentation for a full explanation. HTH, Dp. On 28 Feb 2007 at 19:05, Tatiana Lloret Iglesias wrote: > Yes! that's the problem, GET method doesnt allow very

Re: URL too long

2007-02-28 Thread Tom Smith
Tatiana Lloret Iglesias wrote: Yes! that's the problem, GET method doesnt allow very very long url's ... how can I use POST from Perl code? do you have any example? GET and POST are part of XHTML, not Perl. All you need to do is change your tag to include method="post" instead of method="get"

Re: URL too long

2007-02-28 Thread Tatiana Lloret Iglesias
but the problem is that i cannot modify form html code because it's a public external website ... Thanks! t -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: URL too long

2007-02-28 Thread Tom Smith
Tatiana Lloret Iglesias wrote: but the problem is that i cannot modify form html code because it's a public external website If the QUERY_STRING is too long for the URL, your only option is to use POST. GET will allow for "canned" queries--that is, you can create a link that will execut

A long shot

2007-02-28 Thread Beginner
Hi All, This is a long shot. I have a list of files: hash.buckets page.index page.wordlist word.list word.index hash.file They are part of a SQL/Apache/mod_perl installation and these are some kind of indices for searches. I want to examine the contents if possible. It's quite possible that

Re: A long shot

2007-02-28 Thread Tom Phoenix
On 2/28/07, Beginner <[EMAIL PROTECTED]> wrote: I have a list of files: hash.buckets page.index page.wordlist word.list word.index hash.file They are part of a SQL/Apache/mod_perl installation and these are some kind of indices for searches. I want to examine the contents if possible. Have

Re: A long shot

2007-02-28 Thread Beginner
On 28 Feb 2007 at 9:58, Tom Phoenix wrote: > On 2/28/07, Beginner <[EMAIL PROTECTED]> wrote: > > > I have a list of files: > > > > hash.buckets > > page.index > > page.wordlist > > word.list > > word.index > > hash.file > > > > > > They are part of a SQL/Apache/mod_perl installation and these are

print if variable matches key

2007-02-28 Thread Brian Volk
Hello, I'm trying to print a tab delimited file based on a colon separated file matching a key in %hash. I've attempted a few different things w/ the colon separated file (splitting it into to variables, making it %hash2) but I'm not having any luck. I'm trying to match up a text file,

authenticating from w/in Perl

2007-02-28 Thread Wright, Gerald C.
I have been using LWP::Simple successfully to download data files from a number of sources. I now have to work with a web site that requires a username and password (which I have) but I have no idea how to get perl to interface and provide that information. Thanks, Jerry ***

Re: authenticating from w/in Perl

2007-02-28 Thread Tom Phoenix
On 2/28/07, Wright, Gerald C. <[EMAIL PROTECTED]> wrote: I have been using LWP::Simple successfully to download data files from a number of sources. I now have to work with a web site that requires a username and password (which I have) but I have no idea how to get perl to interface and provide

Re: cgi calender

2007-02-28 Thread oryann9
--- oryann9 <[EMAIL PROTECTED]> wrote: > --- Tom Phoenix <[EMAIL PROTECTED]> wrote: > > > On 2/27/07, oryann9 <[EMAIL PROTECTED]> wrote: > > > > > Problem: cgi calender daynames are not matching > up > > > with dates. For example: Todays date 02/27/2007 > is > > > being printed under Thursday in

RE: print if variable matches key

2007-02-28 Thread Brian Volk
> -Original Message- > From: Brian Volk [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 28, 2007 1:34 PM > To: beginners@perl.org > Subject: print if variable matches key > > Hello, > > > > I'm trying to print a tab delimited file based on a colon separated file > matching a key

RE: print if variable matches key

2007-02-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Brian Volk [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 28, 2007 12:24 > To: Brian Volk; beginners@perl.org > Subject: RE: print if variable matches key > > > > > -Original Message- > > From: Brian Volk [mailto:[EMAIL PROTECTED] > > Sent: W

RE: print if variable matches key

2007-02-28 Thread Brian Volk
> -Original Message- > From: Wagner, David --- Senior Programmer Analyst --- WGO > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 28, 2007 3:31 PM > To: Brian Volk; Brian Volk; beginners@perl.org > Subject: RE: print if variable matches key > > > > I am jusmping into the mid

Can't use string as a subroutine ref while "strict refs"

2007-02-28 Thread Michael Gale
Hello, I am trying to do the following, do I need to remove the strict option for this to work or is there a better way ? --snip-- sub admin { my $term = shift; my $host = shift; my @actions = ( "ssh_login", "su_login", "su_logout", "ssh_logout", "cmds" ); foreach my

Re: remove line if field one is duplicate

2007-02-28 Thread Rob Dixon
Keenan, Greg John (Greg)** CTR ** wrote: Hi, I have to combine several Unix password files and remove any duplicate accounts - putting this into LDAP. I have the following code that will remove any duplicate whole lines but I need to remove lines only if the first field of the password file is

Re: Characters from encryption

2007-02-28 Thread Neal Clark
You do have some issues with characters. they are called newlines. and carriage returns. hehe, just kidding. show us some code. -n On Feb 28, 2007, at 6:44 AM, Ned Cunningham wrote: Hi all. I have an issue with some characters passed back or read to a file. The character is a right

Re: Can't use string as a subroutine ref while "strict refs"

2007-02-28 Thread Jason Roth
You could turn of strict refs for just that function if you want. sub admin { no strict 'refs'; } Otherwise you could put valid function names in a hash and call it based on that. Something like my @fun = (ssh_login => \&ssh_login, su_login => \&su_login ); ... $fun->{$a}->(); -J

Re: Can't use string as a subroutine ref while "strict refs"

2007-02-28 Thread Tom Phoenix
On 2/28/07, Michael Gale <[EMAIL PROTECTED]> wrote: I am trying to do the following, do I need to remove the strict option for this to work or is there a better way ? There is a better way. my @actions = ( "ssh_login", "su_login", "su_logout", "ssh_logout", "cmds" ); for

Output Order?

2007-02-28 Thread Bill Jones
# Out of curiousity -- why does line 2 get printed first? # open(o,"|cat");print o "I think I am 1st? ^L^M"; $_ = "LINE 2: Jvtu bopuifs Pfsm ibdlfs ..."; y/a-z/za-y/; print __END__ A Note: There is an embedded ^L^M in line 1. Output: LINE 2: Just another Perl hacker ...I think I am 1st? -- WC

Re: Output Order?

2007-02-28 Thread Tom Phoenix
On 2/28/07, Bill Jones <[EMAIL PROTECTED]> wrote: # Out of curiousity -- why does line 2 get printed first? open(o,"|cat");print o "I think I am 1st? ^L^M"; $_ = "LINE 2: Jvtu bopuifs Pfsm ibdlfs ..."; y/a-z/za-y/; print Buffering: cat can't give all of its output until you finish writing t

Not Sure how to start or what to use

2007-02-28 Thread Gladstone Daniel - dglads
I have a text file that can be anywhere from 40,000 lines to 120,000 Lines, I want it to split the file so that no file is larger then 20,000 lines 1) run a line count 2) split the file into pieces * The information contai

FW: remove line if field one is duplicate

2007-02-28 Thread Keenan, Greg John \(Greg\)** CTR **
<[EMAIL PROTECTED]> wrote: > Hi, > > I have to combine several Unix password files and remove any duplicate > accounts - putting this into LDAP. > > I have the following code that will remove any duplicate whole lines but > I need to remove lines only if the first field of the password file is a >

Re: Not Sure how to start or what to use

2007-02-28 Thread Ricky Zhou
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gladstone Daniel - dglads wrote: > I have a text file that can be anywhere from 40,000 lines to 120,000 > Lines, > > I want it to split the file so that no file is larger then 20,000 lines > > 1) run a line count > 2) split the file into pieces No

Re: Not Sure how to start or what to use

2007-02-28 Thread Owen
At Wednesday, 28 February 2007, "Gladstone Daniel - dglads" wrote: >I have a text file that can be anywhere from 40,000 lines to 120,000 >Lines, > >I want it to split the file so that no file is larger then 20,000 lines > >1) run a line count >2) split the file into pieces >***

Re: Not Sure how to start or what to use

2007-02-28 Thread John W. Krahn
Gladstone Daniel - dglads wrote: > I have a text file that can be anywhere from 40,000 lines to 120,000 > Lines, > > I want it to split the file so that no file is larger then 20,000 lines > > 1) run a line count > 2) split the file into pieces perl -pe'($.-1)%20_000 or open STDOUT,">",$ARGV

Re: Can't use string as a subroutine ref while

2007-02-28 Thread Jeff Pang
> I am trying to do the following, do I need to remove the strict option > for this to work or is there a better way ? > >--snip-- >sub admin { > > my $term = shift; > my $host = shift; > > my @actions = ( "ssh_login", "su_login", "su_logout", "ssh_logout", > "cmds" ); > >

Re: Not Sure how to start or what to use

2007-02-28 Thread Jeff Pang
>I have a text file that can be anywhere from 40,000 lines to 120,000 >Lines, > >I want it to split the file so that no file is larger then 20,000 lines > >1) run a line count >2) split the file into pieces Hello, Unix/Linux has a "split" shell command which is very suitable for your purpose.

Re: Output Order?

2007-02-28 Thread David Moreno Garza
Tom Phoenix wrote: > On 2/28/07, Bill Jones <[EMAIL PROTECTED]> wrote: > > ># Out of curiousity -- why does line 2 get printed first? > > >open(o,"|cat");print o "I think I am 1st? ^L^M"; > >$_ = "LINE 2: Jvtu bopuifs Pfsm ibdlfs ..."; y/a-z/za-y/; print > > Buffering: cat can't give all of its