help-bash
[Top][All Lists]
Advanced

[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




reply via email to

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