This one has caught me twice over the years:

chmod -R go-rwx subdir/.*

On the next reboot things fail because the entire file system is no longer 
readable to anyone but the file owner.

I switched to ZSH after this conversation last week, and I am liking it. I just 
wish that on Ubuntu the default .zshrc was as useful as the default .bashrc.

I really like that anything that works in Bash appears to work in Zsh, so the 
learning curve isn't bad at all.

Richard

On Monday April 4 2011 11:35:57 Andrew McNabb <[email protected]> wrote:
> On Sun, Apr 03, 2011 at 09:58:04AM -0600, Peter McNabb wrote:
> > 
> > I tried it:
> > 
> > $ mkdir /tmp/foo; cd /tmp/foo; touch .a; touch b; rm -rf .*; ls -al
> > rm: cannot remove directory: `.'
> > rm: cannot remove directory: `..'
> > total 8
> > drwxrwxr-x   2 pmcnabb pmcnabb 4096 Apr  3 09:59 .
> > drwxrwxrwt. 19 root    root    4096 Apr  3 09:59 ..
> > -rw-rw-r--   1 pmcnabb pmcnabb    0 Apr  3 09:59 b
> 
> You'll notice that "rm" is reporting that it is refusing to delete "."
> or "..", but bash is still matching these special directories with the
> ".*" glob.  So the "rm" people realized that this is a problem and have
> a special case for it (not a bad idea).  Many other commands don't and
> shouldn't have special cases.  Try "ls .*" or "mv .* some-other-dir" or
> any other command using the ".*" glob.  To get the desired behavior in
> general for such situations, you have to specify ".??* .[^.]" instead.
<snip>
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to