Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to prevent alias expansion
- X-seq: zsh-workers 26243
- From: JÃrg Sommer <joerg@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: How to prevent alias expansion
- Date: Sun, 4 Jan 2009 15:57:34 +0000 (UTC)
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=gnuu.de; s=banki; t=1231086818; i=@xxxxxxxxxxxx; bh=XwjwwWe39MyOF6gYeyPWSe2mvHCEHgQem BVfO/4UAEw=; h=To:From:Subject:Date:Message-ID:Mime-Version: Content-Type:Content-Transfer-Encoding:Sender; b=NYIvYB8SgY6FTN1as 1yuPgcwcS2tmacIq6UpIzXL5SbkR506XpTSkt1SlfWvyHWl5zgLLxDFbrZdr8owamNY yZH8l9ONN558H3eODZh/BUqyB0FO3EEtNzleChXMzvnQjw5qMEi9gCvnqgjLlbNQwOo 6nfnpfftnz0PkoYK4R7o=
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Sender: news <news@xxxxxxxxxxxx>
Hi,
I've a problem with alias expansion. When using run-help and an global
alias for redirect to /dev/null the command fails.
% alias -g DN='>/dev/null'
% git show DN<ESC h>
<empty output>
I propose this patch:
commit f7d81342f5d1a17879cbee0c2d0e602451f21e19
Author: JÃrg Sommer <joerg@xxxxxxxxxxxx>
Date: Sun Jan 4 16:50:00 2009 +0100
Doubleâquote the argument of specialized run-help functions
Quoting the arguments of the run-help-$CMD functions only one time makes
eval expands them. In the case of a global alias DN='>/dev/null' the
output of the functions gets redirected to /dev/null, which is bad.
% alias -g DN='>/dev/null'
% run-help-foo () { echo bar; }
% foo <ESC h>
foo not found
bar
% foo DN<ESC h>
foo not found
%
diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help
index f8aef0d..d0c3efe 100644
--- a/Functions/Misc/run-help
+++ b/Functions/Misc/run-help
@@ -101,7 +101,7 @@ do
do
shift cmd_args
done
- eval "run-help-$1:t ${(q@)cmd_args[2,-1]}"
+ eval "run-help-$1:t ${(qq@)cmd_args[2,-1]}"
else
man $@:t
fi
Bye, JÃrg
--
Stasi 2.0 â http://www.dataloo.de/stasi-20-525.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author