You are not logged in.

#1 2012-09-14 00:51:05

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

zsh alias question [solved (sort of)]

In my .zshrc, I have this line:

source /path/to/aliases_file

. The aliases file contains the line

alias -- -=popd

. When I log in or create a new urxvt window, I get the message:

/path/to/aliases_file:1: bad option: -=

But if I run exactly the same command manually,

alias -- -=popd

it works. Can anyone explain this to me? And is there a way to get the source command to apply that alias file without throwing the error?

Thanks.

Last edited by ibrunton (2012-09-15 13:49:29)

Offline

#2 2012-09-15 02:51:13

eyeck
Member
Registered: 2011-10-16
Posts: 5

Re: zsh alias question [solved (sort of)]

eyeck% zsh --version
zsh 5.0.0 (x86_64-unknown-linux-gnu)
eyeck% cat .zshrc
source aliases
eyeck% cat aliases
alias -- -=popd
eyeck% zsh
eyeck% -
popd: directory stack empty
eyeck% alias
-=popd
run-help=man
which-command=whence

Copied and pasted the command directly from your post. I am using extra/zsh 5.0.0-2 without any custom patches or anything of the sort.

Last edited by eyeck (2012-09-15 02:55:03)

Offline

#3 2012-09-15 13:49:11

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: zsh alias question [solved (sort of)]

I ended up defining it as a function instead:

function -() { popd }

Offline

Board footer

Powered by FluxBB