I'm trying to set alias conky-lua ="conky -c ./.conky/conkyrc &" so to start conky-lua. but when I source .zshrc it says command not found.

A possible solution that I found on Stackoverflow is to set alias ls='ls -GpF'didn't solve the problem

  • 1
    Avoid spaces around the = symbol... – Rmano Apr 23 '14 at 12:57
  • @Rmano ok thank you, I think that was the issue – Lynob Apr 23 '14 at 13:03

The problem is the space around the = in the command. Look:

[:~] % alias a=ls 

this works as expected

[:~] % type a
a is an alias for ls


[:~] % alias b =ls    
[:~] 1 % 

This does not work. zsh see two words, b and =ls; it uses the pathname expansion on the second one, and execute alias b /bin/ls --- it exits silently with error code 1 because neither b or /bin/ls are alias (alias without = checks if a name is an alias).

[:~] 1 % alias c ="ls -l"
zsh: ls -l not found
[:~] 1 % 

This fails in a more strange way; the shell is trying to expand the full path of the command "ls -l" (with the embedded space in the command name) and so it is failing in looking for it.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.