zsh-users
 help / color / mirror / code / Atom feed
* POSIX
@ 2004-02-01 15:44 Thorsten Haude
  2004-02-01 17:15 ` POSIX Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Haude @ 2004-02-01 15:44 UTC (permalink / raw)
  To: Zsh User ML

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Hi,

I found the following line in Posix (Shell Command Language, Pattern
Matching Notation, Patterns Matching a Single Character):

    A bracket expression starting with an unquoted circumflex
    character produces unspecified results.

That would mean that you should not use '.[^.]*' to find hidden files.
Instead it is stated to use '.[!.]*', which does not work in Zsh:

yooden@eumel % ls .[!.]*
zsh: event not found: .]

('.[\!.]*' works though.)


I sense a disturbance in the Force here. Why does Zsh not follow Posix
here? What am I missing?


Thorsten
-- 
A future startup with no patents of its own will be forced to pay whatever
price the giants choose to impose. That price might be high: Established
companies have an interest in excluding future competitors.
    - Bill Gates

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: POSIX
  2004-02-01 15:44 POSIX Thorsten Haude
@ 2004-02-01 17:15 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2004-02-01 17:15 UTC (permalink / raw)
  To: Zsh User ML

On Feb 1,  4:44pm, Thorsten Haude wrote:
} 
} That would mean that you should not use '.[^.]*' to find hidden files.
} Instead it is stated to use '.[!.]*', which does not work in Zsh:

It does work, if you "unsetopt banghist" -- and having banghist unset is
the default state in NON-interactive shells, so any shell script that
uses the POSIX form would work correctly.  The circumflex form is for
backwards compatibility and as a shortcut in interactive shells so that
you don't have to type the extra backslash.

} ('.[\!.]*' works though.)

And that, in fact, would NOT work in a shell script, because the history
mechanism in the interactive line editor is what removes the backslash.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-01 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-01 15:44 POSIX Thorsten Haude
2004-02-01 17:15 ` POSIX Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).