Re: Copy all desktop settings for a new user
On Sunday 14 December 2003 08:49 am, Philipp Schulte wrote:
> Nunya wrote:
> > I do it for these files:
> >
> > desk:/mnt/apt/inst/dotfiles# ls
> > dot.fetchmailrc dot.gnome dot.gtkrc-1.2-gnome2
> > dot.procmailrc dot.xsession
> > dot.fluxbox dot.gnome2 dot.gtkrc-2.0 dot.profile
> > dot.gbuffyrc dot.gnome2_private dot.kde dot.qt
> > dot.gconf dot.grun_history dot.kderc dot.xmms
> > dot.gconfd dot.gtkrc dot.muttrc
> > dot.xscreensaver
>
> I don't get it. You are talking about copying the files. This of
> course is not a problem, but what do you do if you have to change the
> content of hundreds of files for each user?
Something like this (this is tcsh syntax, so sue me):
set newuser =
set olduser =
foreach file ( dotfiles/* )
cat $file | sed "s/$olduser/$newuser/g" > /home/$newuser/$file
end
Untested, of course, but that ought to give you the idea.
man sed
man tcsh
Cheers,
Terry
--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com
Reply to: