bug-coreutils
[Top][All Lists]
Advanced

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

Re: bugreport for chmod -R


From: Bob Proulx
Subject: Re: bugreport for chmod -R
Date: Thu, 20 Oct 2005 10:47:26 -0600
User-agent: Mutt/1.5.9i

Christian Spielberger wrote:
> :~/tmp$ ls -l
> insgesamt 8
> drwxr-xr-x 2 chris chris 4096 2005-10-20 09:28 dir0
> 
> :~/tmp$ ls -l dir0
> insgesamt 4
> -rwxr--r-- 1 chris chris 5 2005-10-20 09:28 foo.txt
> 
> :~/tmp$ chmod -R u+x *.txt
> chmod: Zugriff auf „*.txt“ nicht möglich: Datei oder Verzeichnis nicht 
> gefunden
> 
> in zsh:
> 
> $ chmod -R u+x *.txt ~/tmp
> zsh: no matches found: *.txt

Thanks for your bug report.  But what you are seeing is not a bug.
You are being confused by thinking that *.txt somehow recurses down a
file tree.  But *.txt is a file glob that is expanded by the shell on
the command line and the results are handed to the program.

Please see this reference document for more details.
Look for "Why doesn't rm -r *.pattern recurse like it should?"

  http://www.gnu.org/software/coreutils/faq/

The recommended way is to use 'find' to find files matching a pattern.

  find . -name '*.exe' -print0 | xargs -r0 chmod u+x

By the way, normally .txt files indicate plain text files and are not
executable.  So you normally would not want to set the execute bit on
them.  I think that is another point of confusion.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]