On Thu, 3 Jan 2002 14:03:37 +0200 (EET), <[EMAIL PROTECTED]> wrote:

> My problem: i have a homedir for around 800 users.I need to get all of
> them in a text file,each one on each line,with @domain.com after their
> username.. something like
> 
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> ..
> 
> how can i do that,with sed,or..
> thanks
> Dani.

Maybe...

<PERL>
#! /usr/bin/perl -w

local $dir="/home";
local $domain="domain.com";

opendir (DIR, "$dir") or die "Couldn't open '$dir'!\n";

local $entry;

while ($entry = readdir(DIR)) {
        next if ($entry =~ m/^\./);
        next if ($entry =~ m/^lost[+]found$/);
        print "$entry" . "\@" . "$domain\n";
}
</PERL>

$ ./thescript > mylist


-- 
Eric G. Miller <egm2@jps.net>

Reply via email to