Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

global alias with leading space gives unexpected thing



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