Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ksh compatibility experts (extendedglob bareglobqual)
- X-seq: zsh-users 14574
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: ksh compatibility experts (extendedglob bareglobqual)
- Date: Tue, 17 Nov 2009 10:16:53 +0000
- In-reply-to: <58942.153.98.68.197.1258450547.squirrel@xxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <58942.153.98.68.197.1258450547.squirrel@xxxxxxxxxxxxxxxxxxx>
"Jerry Rocteur" wrote:
> We're running in ksh compatibility mode (ksh linked to zsh)
>
> What I'd like to do is to write some scripts that make use of Extended Glob a
> nd Glob qualifiers!
>
> I'd like to run something like this:
>
> #!/usr/bin/ksh
>
> setopt extendedglob
> setopt bareglobqual
>
> touch cc.log
> ls (cc|fi).log(N)
> ls cc.log
>
>
> But I have the setopt wrong cause I get this:
>
> ./try.ksh
> ls: (cc|fi).log(N): No such file or directory
> cc.log
You need to "unsetopt shglob". This reenables bare parentheses. (I
managed to get this to work after "emulate ksh", but for some reason not
if I used ARGV0=ksh; I haven't worked out the difference.)
Alternatively, you can use ksh globbing syntax:
ls @(cc|fi).log(N)
This works with glob qualifiers as long as bareglobqual is on.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author