Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Null tilde expansions?
- X-seq: zsh-users 1842
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Greg Badros <gjb@xxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Null tilde expansions?
- Date: Wed, 7 Oct 1998 09:47:33 -0700
- In-reply-to: <9810071511.AA34477@xxxxxxxxxxxxxxxxx>
- In-reply-to: <qrrvhlwv0pm.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <9810071511.AA34477@xxxxxxxxxxxxxxxxx> <qrrr9wly2rn.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx> <981006205428.ZM10148@xxxxxxxxxxxxxxxxxxxxxxx> <qrr67dwwh6p.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx> <981007082641.ZM12497@xxxxxxxxxxxxxxxxxxxxxxx> <qrrvhlwv0pm.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx>
On Oct 7, 5:11pm, Peter Stephenson wrote:
} Subject: Re: Null tilde expansions?
}
} I think the appropriate option is 'nomatch'. (Sounds OK to me, it's a
} match that's failing rather than a pattern that's been typed wrongly.)
I first tried it with just no_nomatch, and got an error. However, now
that I fool with it again, I must have mistyped something else, because
it is indeed only no_nomatch that's required.
On Oct 7, 8:41am, Greg Badros wrote:
} Subject: Re: Null tilde expansions?
}
} > dirs=(${(M)dirs:#~)
}
} Besides the obvious typo of a closing paren for a closing brace, there
} are three problems:
}
} 1) I want the (R)est, not the match, right?
} 2) The ~ needs to be escaped, otherwise it'll get expanded.
} 3) The pattern after the # needs to match the whole word, so it needs a
} trailing *.
Bleah. This is what I get for testing stuff on a machine where the only
home directory is my own, so the expansion of the only valid username
"accidentally" matches the expansion of ~.
Yes, you're right. Or just ${dirs##~*}, in which the ~ is not expanded
in the first place.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author