Re: Nested extglob outputs "." ".."

2018-08-22 Thread Chet Ramey
On 8/22/18 3:19 PM, Michal Pesa wrote: > My bad, sorry for not searching properly before asking. Thank you for your > time. No problem, you should always report against the latest version you have. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars

Re: Nested extglob outputs "." ".."

2018-08-22 Thread Chet Ramey
On 8/22/18 3:57 AM, Michal Pesa wrote: > Hello, I have encountered a strange behavior of nested extended globs: > > $ echo * > .txt 000.txt 00.txt 0.txt a.txt b.txt c.txt > $ echo !(0.txt) > .txt 000.txt 00.txt a.txt b.txt c.txt > $ echo !(+(0).txt) > . .. a.txt b.txt c.txt > > The last

Re: Add sleep builtin

2018-08-22 Thread Greg Wooledge
On Wed, Aug 22, 2018 at 03:54:44PM +0300, Ilkka Virta wrote: > [...] and Bash already supports handling > subsecond times in at least 'read -t', so it's not that far fetched to > implement it in 'sleep' too. Ah, excellent point! OK, that plus the ksh compatibility definitely wins me over.

Re: Add sleep builtin

2018-08-22 Thread Ilkka Virta
On 22.8. 15:22, Greg Wooledge wrote: Just for the record, the POSIX sleep command only accepts an "integral number of seconds specified by the time operand." Sub-second sleep(1) is a GNUism. Or ksh-ism? (Or does it even matter which one it is originally, since Bash is GNU Bash with features

Re: Nested extglob outputs "." ".."

2018-08-22 Thread Greg Wooledge
On Wed, Aug 22, 2018 at 09:57:19AM +0200, Michal Pesa wrote: > Hello, I have encountered a strange behavior of nested extended globs: > > $ echo * > .txt 000.txt 00.txt 0.txt a.txt b.txt c.txt > $ echo !(0.txt) > .txt 000.txt 00.txt a.txt b.txt c.txt > $ echo !(+(0).txt) > . .. a.txt

Re: Add sleep builtin

2018-08-22 Thread Greg Wooledge
On Tue, Aug 21, 2018 at 06:11:14PM -0700, L A Walsh wrote: > sleep .001 (ms sleep)...not practical if loaded each time) > I often use sleep .1/.3/.5 ... if the builtin doesn't support sleep times > < 1 second, then it's probably not worth it. > > Also, needs to actually sleep for the listed time.

Re: Add sleep builtin

2018-08-22 Thread Tadeus Prastowo
On Tue, Aug 21, 2018 at 10:32 PM, don fong wrote: > wouldn't it be less confusing if the proposed built-in sleep function were > given a new name instead of overloading "sleep"? That will complicate the migration effort for people who want to switch to using the built-in sleep, no? -- Best

Nested extglob outputs "." ".."

2018-08-22 Thread Michal Pesa
Hello, I have encountered a strange behavior of nested extended globs: $ echo * .txt 000.txt 00.txt 0.txt a.txt b.txt c.txt $ echo !(0.txt) .txt 000.txt 00.txt a.txt b.txt c.txt $ echo !(+(0).txt) . .. a.txt b.txt c.txt The last example correctly excludes the files but why are "." ".."