Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
why is the - modifier useful
- X-seq: zsh-users 30291
- From: Marc Chantreux <mc@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: why is the - modifier useful
- Date: Tue, 1 Jul 2025 10:26:38 +0200
- Archived-at: <https://zsh.org/users/30291>
- Dkim-filter: OpenDKIM Filter v2.10.3 zmtaauth04.partage.renater.fr E65E21C05FC
- List-id: <zsh-users.zsh.org>
hello people,
I did a demo of autocd and alias -s to coworkers
and concluded I never use the cd command again in interactive
sessions except for history.
"Why?" they said.
"Because I'm used to it ..."
then I realize this custom came for reason: - is already a
builtin which seems really useless to me:
Doc/Zsh/grammar.yo:114:findex(-)
Doc/Zsh/grammar.yo-115-item(tt(-))(
Doc/Zsh/grammar.yo-116-The command is executed with a `tt(-)' prepended to its
Doc/Zsh/grammar.yo-117-tt(argv[0]) string.
Doc/Zsh/grammar.yo-118-)
Back then, I just stayed away from this but time passed and I still don't even
understand why is this useful and *never ever saw this used*. I'm tempted to
use - as a short for 'cd -' (it would be awsome combined with completion).
So I have 2 questions for you guys:
* Is this a stupid move?
* Why the hell this builtin is useful?
regards
Marc
Messages sorted by:
Reverse Date,
Date,
Thread,
Author