Re: [SLUG] Re: chmod probs. - add. info

2009-04-09 Thread James Polley
On Fri, Apr 10, 2009 at 2:43 PM, Daniel Pittman  wrote:
> Bernie Pannell  writes:
>
>> try doing the 2 commands in the opposite order, setting everything to
>> 664, & then set the directories to 775, ie:
>>
>> chmod -R 664*
>> chmod -R 775 *.
>
> Epic FAIL!
>
> The first command will remove the execute bit from every directory,
> causing you some incredible grief, and then the second command just
> won't work because you no longer have permissions to get at the
> contained files sensibly.

Homework:

mkdir A
touch A/B
touch A/C
chmod u-x A
ls -l A
rm A/B

marvel at the weird. Also, remember, because one day you'll see this
behaviour again, and having seen it before will save you from a very
baffling 30 minutes while you fight against the machine.

>
> It /could/ work if you did this:  chmod -R ug=rwX,o=rX *
>
> That uses the GNU chmod specific "only set executable if this is a
> directory" flag,

Close. Quoting from the man page:

execute/search only  if  the file is a directory or already has
execute permission for some user

Hrm. "Only if the file is a directory" could probably be worded better.

> which works more nicely, but probably isn't exactly the
> right answer in the long term.
>
> Regards,
>        Daniel
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: chmod probs. - add. info

2009-04-09 Thread Daniel Pittman
Bernie Pannell  writes:

> try doing the 2 commands in the opposite order, setting everything to
> 664, & then set the directories to 775, ie:
>
> chmod -R 664*
> chmod -R 775 *.

Epic FAIL!

The first command will remove the execute bit from every directory,
causing you some incredible grief, and then the second command just
won't work because you no longer have permissions to get at the
contained files sensibly.

It /could/ work if you did this:  chmod -R ug=rwX,o=rX *

That uses the GNU chmod specific "only set executable if this is a
directory" flag, which works more nicely, but probably isn't exactly the
right answer in the long term.

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: chmod probs. - add. info

2009-04-09 Thread Daniel Pittman
Kyle  writes:

> Have to admit, when I read Daniel's response telling me to use "find",
> I cringed. All my experiences with "find" have been very
> tortoise-like. But that command came back instantaneously and did the
> trick.

Heh.  I can't blame you: find is probably the most awful of the standard
Unix commands, not least because whoever wrote it carefully set out to
design the most user-confusing interface ever.

It *looks* like find takes a set of arguments, just like any other Unix
command, given they all start with a '-', eh?

Don't be fooled, though.  find(1) actually takes a description, written
in a mini-language, that details what to find and what to do when you
get there.

Ignore the dash and think about it being a language, just like shell,
and things become clearer, because now it makes *sense* that the
arguments have different meanings in different orders.


Unix: proof that just being old, and standard, doesn't make it sane.

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: chmod probs. - add. info

2009-04-09 Thread Kyle

Thanks all.

Have to admit, when I read Daniel's response telling me to use "find", I 
cringed. All my experiences with "find" have been very tortoise-like. 
But that command came back instantaneously and did the trick.


Thanks again.


Kind Regards

Kyle



James Polley wrote:

On Fri, Apr 10, 2009 at 12:32 PM, Kyle  wrote:

I should clarify;

But then if I do a chmod -R 664 *.jpg (and

repeat for all other extensions), for some reason the chmod doesn't work.

it works in the directory I'm presently in, but doesn't recurse.


Yes. Daniel explained why: *.jpg expands to a list of all files whose
name ends with .jpg *in the current folder*. There are no directories
in that list, so chmod has nothing to recurse into.

Daniel provided some find fu which should do what you want (I haven't
tried it, just glanced over it).



Kind Regards

Kyle

Kyle wrote:

Hi Sluggers,

I'm having a bit of grief with chmod and am hoping one of you gurus will
set me straight pls.

I have a bunch of directories with a bunch of files (pictures) in each. I
want to set directories to 775 and files to 664.

I can do a chmod -R 775 *. But then if I do a chmod -R 664 *.jpg (and
repeat for all other extensions), for some reason the chmod doesn't work.

the man page says; 'chmod -R ug=rwxX *' (if I understand it correctly)
should change just the directories permissions for owner and group. (and I
could do an o=rxX after). But that just works on everything as well.

What am I missing?


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: chmod probs. - add. info

2009-04-09 Thread James Polley
On Fri, Apr 10, 2009 at 12:32 PM, Kyle  wrote:
> I should clarify;
>
> But then if I do a chmod -R 664 *.jpg (and
>> repeat for all other extensions), for some reason the chmod doesn't work.
>
> it works in the directory I'm presently in, but doesn't recurse.

Yes. Daniel explained why: *.jpg expands to a list of all files whose
name ends with .jpg *in the current folder*. There are no directories
in that list, so chmod has nothing to recurse into.

Daniel provided some find fu which should do what you want (I haven't
tried it, just glanced over it).

>
> 
> Kind Regards
>
> Kyle
>
> Kyle wrote:
>>
>> Hi Sluggers,
>>
>> I'm having a bit of grief with chmod and am hoping one of you gurus will
>> set me straight pls.
>>
>> I have a bunch of directories with a bunch of files (pictures) in each. I
>> want to set directories to 775 and files to 664.
>>
>> I can do a chmod -R 775 *. But then if I do a chmod -R 664 *.jpg (and
>> repeat for all other extensions), for some reason the chmod doesn't work.
>>
>> the man page says; 'chmod -R ug=rwxX *' (if I understand it correctly)
>> should change just the directories permissions for owner and group. (and I
>> could do an o=rxX after). But that just works on everything as well.
>>
>> What am I missing?
>>
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: chmod probs. - add. info

2009-04-09 Thread Bernie Pannell
try doing the 2 commands in the opposite order, setting everything to 664, &
then set the directories to 775, ie:

chmod -R 664*
chmod -R 775 *.

Regards,
Bernie.

On Fri, Apr 10, 2009 at 12:32 PM, Kyle  wrote:

> I should clarify;
>
> But then if I do a chmod -R 664 *.jpg (and
> > repeat for all other extensions), for some reason the chmod doesn't work.
>
> it works in the directory I'm presently in, but doesn't recurse.
>
> 
> Kind Regards
> Kyle
>
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] chmod probs.

2009-04-09 Thread Daniel Pittman
Kyle  writes:

> I'm having a bit of grief with chmod and am hoping one of you gurus
> will set me straight pls.

You have a problem with argument globbing on Unix, not chmod, which
might explain why you are having trouble finding out what is going
wrong.

> I have a bunch of directories with a bunch of files (pictures) in
> each. I want to set directories to 775 and files to 664.
>
> I can do a chmod -R 775 *. But then if I do a chmod -R 664 *.jpg (and
> repeat for all other extensions), for some reason the chmod doesn't
> work.

Sure it does, but what actually happens is:

1. You enter 'chmod -R 644 *.jpg' into the shell.
2. The shell expands the '*.jpg' part into a list of files matching that
   pattern (implicitly in the current directory.)
3. The shell runs 'chmod -R 644 example1.jpg example2.jpg etc.jpg'
4. chmod recurses if any of the arguments are a directory, which none of
   them are because only *.jpg files were matched.

So, everything works as designed, but '-R' doesn't do quite what you
thought, and neither does the '*.jpg' argument.

Also, if you quote the glob you *still* don't get what you want, because
chmod (like almost all Unix commands) doesn't do internal globbing, it
expects external globbing, so you would get:

  ] chmod -R 644 '*.jpg'
  chmod: cannot access `*.jpg': No such file or directory

[...]

> What am I missing?

find(1), which is used to locate a list of files matching a given set of
criteria, allowing you to do something like this:

  chmod -R 644 `find -name '*.jpg'`

(Note the single-quotes around the glob pattern?  Without that the shell
 would expand the pattern, which would cause a syntax error for the find
 command, and not do what you want.)

There is a limit to the number of arguments you can pass to chmod,
though, so it is generally speaking better to structure that like this:

  find -name '*.jpg' | xargs chmod -R 644

That falls apart if any of your filenames have spaces in them, though,
since xargs splits on *any* whitespace; to work around that use:

  find -name '*.jpg' -print0 | xargs -0 chmod -R 644

See the manual pages for the fine detail, obviously.

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Re: chmod probs. - add. info

2009-04-09 Thread Kyle

I should clarify;

But then if I do a chmod -R 664 *.jpg (and
> repeat for all other extensions), for some reason the chmod doesn't work.

it works in the directory I'm presently in, but doesn't recurse.


Kind Regards

Kyle

Kyle wrote:

Hi Sluggers,

I'm having a bit of grief with chmod and am hoping one of you gurus will 
set me straight pls.


I have a bunch of directories with a bunch of files (pictures) in each. 
I want to set directories to 775 and files to 664.


I can do a chmod -R 775 *. But then if I do a chmod -R 664 *.jpg (and 
repeat for all other extensions), for some reason the chmod doesn't work.


the man page says; 'chmod -R ug=rwxX *' (if I understand it correctly) 
should change just the directories permissions for owner and group. (and 
I could do an o=rxX after). But that just works on everything as well.


What am I missing?


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] chmod probs.

2009-04-09 Thread Kyle

Hi Sluggers,

I'm having a bit of grief with chmod and am hoping one of you gurus will 
set me straight pls.


I have a bunch of directories with a bunch of files (pictures) in each. 
I want to set directories to 775 and files to 664.


I can do a chmod -R 775 *. But then if I do a chmod -R 664 *.jpg (and 
repeat for all other extensions), for some reason the chmod doesn't work.


the man page says; 'chmod -R ug=rwxX *' (if I understand it correctly) 
should change just the directories permissions for owner and group. (and 
I could do an o=rxX after). But that just works on everything as well.


What am I missing?

--

Kind Regards

Kyle
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Latest or recommended ways to display Gnome Desktop from Windows boxes.

2009-04-09 Thread Michael Lake

Hi all

Just a follow up and a thanks. I've setup the user with Xming - opening a Putty 
connection, starting the Xming Windows server and then starting the programs from a 
putty terminal. Works fast and not sluggish. They mainly use only a few apps (a very 
pricy IDL being one).


I could not get a full Gnome desktop with Xming appearing due to "bad packet length 
errors" and permissions problems. I just couldn't work that out. I also had probs 
with vnc. At least this will work for now.


Thanks Alex, Ken, Chris, Roger, Jake & David for the suggestions.

Michael Lake wrote:

I need get get several MS Windows users access to a Fedora Linux box.
I have nxserver from nomachine on at present and it works very well but 
it's limited to just two users. I had tried previously using freenx but 
I could not get it to work as there seemed to be many library problems 
in the package.


This review here shows a lot more than I wanted to see!
http://en.wikipedia.org/wiki/Comparison_of_remote_desktop_software#cite_note-SSHwithX_sessions-4 

I basically want a free/open source server for Linux and a free client 
for Windows for several users to display a Gnome desktop. Plain ssh -X 
is not sufficient.


What have you found that is modern and works well that you have tried?

Mike



--
Michael Lake
Computational Research Centre of Expertise
Science Faculty, UTS
Ph: 9514 2238




--
UTS CRICOS Provider Code:  00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.  If
you have received this message in error, please notify the sender immediately
and delete this message. Any views expressed in this message are those of the
individual sender, except where the sender expressly, and with authority,
states them to be the views of the University of Technology Sydney. Before
opening any attachments, please check them for viruses and defects.

Think. Green. Do.

Please consider the environment before printing this email.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html