Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
global alias with leading space gives unexpected thing
- X-seq: zsh-workers 27928
- From: Dmitry Bolshakov <bdimych@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: global alias with leading space gives unexpected thing
- Date: Wed, 28 Apr 2010 01:41:24 +0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1272404485; bh=3fDetE3EMS9f19aDMtI6OF/beT5z/9byaAJmVG+xzks=; h=From:To:Subject:MIME-Version:Message-Id:Date: Content-Transfer-Encoding:Content-Type; b=FRXlIVe+kIpS8j/hPOJa7QeHQKNO+HMY6GnPylPX20HnODmqLEzgkJ6F8zUSSwQHg dhJ1aw5fnXARUPDHd6biLrrRJB+9lpLL5AIdowiW6YfOsGy7e4BB95RSvQMaev2r1+ KW4B/1p4wub7oboSN23iVuVlCT93+9EbDeg++RJM=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
hi
there it is, copy-paste this into the shell
====================================================
setopt histignorespace
: ---------- if there is leading space in the alias
alias -g X=' >/dev/null'
true X
history -1
: ---------- then the command with the alias is absent in the history
: ---------- if no leading space
alias -g X='>/dev/null'
true X
history -1
: ---------- then the command is present
: ---------- if leading space, but the histignorespace is off
alias -g X=' >/dev/null'
setopt no_histignorespace
true X
history -1
: ---------- then also present
====================================================
this seems strange a bit for me
i always imagined that a count of spaces does not matter
all
somecommand >/dev/null
somecommand >/dev/null
somecommand >/dev/null
are the same, isn't it so?
--
with best regards
Dmitry Bolshakov
Messages sorted by:
Reverse Date,
Date,
Thread,
Author