[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] How to safely work on files/dirs with .
From: |
Stephane Chazelas |
Subject: |
Re: [Help-bash] How to safely work on files/dirs with . |
Date: |
Mon, 14 Mar 2016 03:17:48 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
2016-03-12 18:48:37 -0700, Bob Proulx:
[...]
> If you want the bash way for matching characters that are not a dot:
>
> chown -R test:test /home/test/.[!.]*
[...]
Note that it misses files like ..foo or ... (you'd need to add
an extra ..?* glob for them).
zsh, pdksh (and derivatives, actually derivatives of the Forsyth
shell which pdksh is based on) and fish expansions never
include "." nor ".." in their glob expansions, so you can use .*
reliably in those shells.
Interestingly, the legend says that the reason dot files are
hidden is because of a typo in an early implementation of ls or
glob that meant to exclude "." and ".." but ended up excluding
anything starting with . instead.
--
Stephane
- [Help-bash] How to safely work on files/dirs with ., David Niklas, 2016/03/12
- Re: [Help-bash] How to safely work on files/dirs with ., Bob Proulx, 2016/03/12
- Re: [Help-bash] How to safely work on files/dirs with .,
Stephane Chazelas <=
- Re: [Help-bash] How to safely work on files/dirs with ., Greg Wooledge, 2016/03/14
- Re: [Help-bash] How to safely work on files/dirs with ., Stephane Chazelas, 2016/03/14
- Re: [Help-bash] How to safely work on files/dirs with ., Greg Wooledge, 2016/03/14
- Re: [Help-bash] How to safely work on files/dirs with ., Stephane Chazelas, 2016/03/14
- Re: [Help-bash] How to safely work on files/dirs with ., Bob Proulx, 2016/03/19
- Re: [Help-bash] How to safely work on files/dirs with ., Greg Wooledge, 2016/03/21
- Re: [Help-bash] How to safely work on files/dirs with ., Eric Blake, 2016/03/21