in reply to Re: Re: Look for ~*/.netscape/ dirs
in thread Look for ~*/.netscape/ dirs

From your snippet, I couldn't see if it actually did go through all the homes (getpwent's worthy, but still, where's the full search?)

Of course, there's...

open(IN,"</etc/passwd"); while(<IN>) { chomp; next unless(/^([^:]+):/); $names=`find ~$1/.netscape -name prefs.js -o -name liprefs.js -pri +nt`; @names=split /\n/, $names; push @files, @names; }

--
$Stalag99{"URL"}="http://stalag99.keenspace.com";

Replies are listed 'Best First'.
Re: Re: Re: Re: Look for ~*/.netscape/ dirs
by merlyn (Sage) on Apr 15, 2001 at 02:06 UTC
    Uh, getpwent returns all the info for all the users, and therefore all the homes.

    Yours fails on a system that is YP'ed, er, NIS'ed.

    -- Randal L. Schwartz, Perl hacker

      YP/NIS uses a different way of specifying users other than /etc/passwd, eh? I'm left wondering if it's part of the POSIX spec or somewhere standard....

      --
      $Stalag99{"URL"}="http://stalag99.keenspace.com";

Re(4): Look for ~*/.netscape/ dirs
by yakko (Friar) on Apr 15, 2001 at 09:13 UTC
    strredwolf:
    (getpwent's worthy, but still, where's the full search?)

    Basically, what happens is the grep tests each potential dir returned by its 2nd arg (the do block) to see if it's a directory. If it is, the entry ends up in @dirs...

    It took me ages to figure this out, so it's worthy of a repeat. :o)

    (Yes, it took 4 reads of perldoc -f grep to finally parse correctly.)

    --
    Me spell chucker work grate. Need grandma chicken.