[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] How to safely work on files/dirs with .
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] How to safely work on files/dirs with . |
Date: |
Mon, 14 Mar 2016 10:33:43 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Mar 14, 2016 at 02:20:15PM +0000, Stephane Chazelas wrote:
> 2016-03-14 08:40:54 -0400, Greg Wooledge:
> > For completeness, and to get things back on topic for help-bash,
> > bash includes a shopt named "dotglob" which makes * match files
> > beginning with dot.
>
> Note that it doesn't prevent the expansion of . and .. in a .*
> glob (which was the point being discussed here):
>
> $ bash -O dotglob -c 'echo .*'
> . .. .a
So, don't do that.
imadev:~/tmp$ rm *
imadev:~/tmp$ touch .foo bar
imadev:~/tmp$ bash -O dotglob -c 'echo *'
bar .foo
Simple!
- [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, 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 .,
Greg Wooledge <=
- 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