Red Hat Bugzilla – Bug 463167
%M and %m expansions don't work anymore
Last modified: 2008-09-25 07:15:47 EDT
Description of problem:
On a freshly installed F9, print -P "%M %m" returns nothing while on a RHEL 5.2 (for instance) it gives you the FQDN then the hostname.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. print -P "%M %m"
As per the man page:
%M The full machine hostname.
%m The hostname up to the first ‘.’. An integer may follow the ‘%’ to specify how many components of the hostname are desired.
With a negative integer, trailing components of the hostname are shown.
% print -P "%M %m"
% yum list zsh
zsh.x86_64 4.3.4-8.fc9 installed
...got anymore info?
zsh.i386 4.3.4-8.fc9 installed
On my machine (I've got another one at home):
%print -P "%M"
And foobar is in /etc/hosts (I mean a getent ahosts foobar works)...
I guess I'm going to dig in the source...
BY the way I also tried to move my .zshrc out of the way, same result...
Ok, interesting ... if I do "zsh -f" then print "%M" just prints %M.
Prompt sequences undergo a special form of expansion. This type of
expansion is also available using the -P option to the print builtin.
...and print -P "%M" works in zsh -f.
Nice find, with zsh -f, print -P "%M" works again...
Found the culprit, I added this to zshrc:
--- zshrc.orig 2008-05-16 06:17:09.000000000 +0200
+++ zshrc 2008-09-24 11:10:39.000000000 +0200
@@ -26,7 +26,9 @@
if [[ ! -o login ]]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
+ echo $i
+ print -P "%M %m"
And basically it stops here:
So keychain seems to be at fault. The issue is this line:
unset KCHOPTS SSHKEYS GPGKEYS HOST
If you unset HOST, print -P "%M" (or %m) fails...
%print -P "%m %M"
%print -P "%m %M"
Can we transfer this bug to keychain instead of rpm?
I meant "transfer to keychain instead of zsh" of course...
Closed (new bug is 463913).