[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: homedir listing and adding domain..



On Thu, Jan 03, 2002 at 02:03:37PM +0200, dani@cyber.ro 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
> 
> dscfde@domain.com
> 3424.324r2@domain.com
> 4fdr3r@domain.com
> ..
> 
> how can i do that,with sed,or..
I suggest awk:

You can get a list with ls and then use awk.
awk '{print $1 "@domain.com"}' < your-file-here

Or something like this:

blah=$(ls /home/blah)
for x in $blah
do
echo "$x@domain.com" >> outfile.txt
done

Sven

-- 
>Lamer! :)\n Lokaler Admin mit enormen Rechten[tm]
[Christian Schneider und Jens Himmelrath in alt.hacker.org-gcf]
http://www.linux-secure.de http://www.linuxboard.de
http://www.bluephod.net http://www.disconow.de



Reply to: