On Mon, 2 Sep 2002, Mike Burger wrote:
> Date: Mon, 2 Sep 2002 21:21:59 -0500 (EST)
> From: Mike Burger <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: how to automatically put files on all /home/user directories
>
> Actually, you could "touch /home/*/filename".
Try it; this will not work (bash will expand the expression above to a
list of existing files named 'filename' in each subdirectory of /home;
I would suggest the following: run as root
cat /etc/passwd | awk -F: '{print $6," ", $3," ", $4}' | egrep '^/home' \
| while read p u g; do
echo "touch $p/filename; chown $u:$g $p/filename"; done
and save results to /root/touch_filename;
The edit that file, remove unneeded entries (e.g. for system accounts
having home directory in /home) and finally
bash /root/touch_filename
This assumes that home directories and filename does not contain spaces,
etc.
As other said, if you put filename with /etc/skel it will be automatically
created in each new user home directory.
Best regards,
Wojtek
>
> On Mon, 2 Sep 2002, smoke wrote:
>
> > thanks,
> >
> > i can use that too! but i have another 500+ existing
> > users, and it may take a bit of time to use "touch"
> > for every /home/user directory... is there a way to do
> > that? thank you! :)
> >
> >
> > --- Chris Mason <[EMAIL PROTECTED]> wrote:
> > > put it in /etc/skel - I think
> > > Only works when you crreate the user.
[...]
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list