Mailinglist Archive: opensuse-edu (72 mails)

< Previous Next >
Re: [suse-linux-uk-schools] Open Office
  • From: Thomas Adam <thomas_adam16@xxxxxxxxx>
  • Date: Fri, 8 Aug 2003 12:47:09 +0000 (UTC)
  • Message-id: <20030808124706.54069.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
--- Samuel Deakin <sam.deakin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> I am fairly new to Linux so could you just break down the srcipt below
> and
> explain what each bit means and is doing, Cheers, Sam

> > for i in $(ls -1 /home/* | grep -v test3 samdea anix); do cp -r
> > /some/working/config /home/$i/.some_location && chown -R $i.groupname;
> > done

OK, what the above does is this:

1. It will display (one per line) all the directories in /home
2. Then they are passed through "grep" which as the -v flag is present,
filter out the ones you don't need (i.e. test3, etc).
3. This is then stored in $i
4. Then using $i, cp then copies your working OO installation (which
you'll have to change as appropriate) to /home/$i (again change the
".some_location".
5. If the cp worked (&& is logical AND) then it will set the perms (chown
-R is recursive) as the $i (user) and groupname (probably use "users".

I have actually forgotton to add something so, the proper script is:

for i in $(ls -1 /home/* | grep -v test3 samdea anix); do cp -r \
/some/working/config /home/$i/.some_location && chown -R $i.users \
/home/$i/.some_location; done

The "\" at the end of line, act as a continuator, but you should type the
above in all on one-line when you come to run it.

The reason why others on this list may wonder why "$i" is going to work,
is because typically the /home/$USER actually takes on the groupname
verbatim.

HTH,

-- Thomas Adam

> >
> > Or....
> >
> > you could have a central configuration say in /opt which is set to:
> >
> > chmod o+rwx
> >
> > which is then a symlink in each user's $HOME.
> >
> > Does that answer your question?
> >
> > -- Thomas Adam
> >
> > =====
> > Thomas Adam
> >
> > "The Linux Weekend Mechanic" -- www.linuxgazette.com
> >
> >
> ________________________________________________________________________
> > Want to chat instantly with your online friends? Get the FREE Yahoo!
> > Messenger http://uk.messenger.yahoo.com/
>
>

=====
Thomas Adam

"The Linux Weekend Mechanic" -- www.linuxgazette.com


=====
Thomas Adam

"The Linux Weekend Mechanic" -- www.linuxgazette.com

________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

< Previous Next >
References