Error while trying to execute a binary file whit zsh alias

42 Views Asked by At

i got a binary file in a specific directory and I was trying to make an alias in my .zshrc file to execute the binary file. And I was getting this error message when I try to run it:

jupiter
zsh: can't open input file: /home/josh/Documents/cc3/images/bin/./jupiter

I wrote the alias like this:

alias jupiter="zsh ~/Documents/cc3/images/bin/./jupiter"

Then I wrote the command omz reload to apply changes to the .zshrc file, but I'm still getting the same error.

Could anyone help me and let me know what I am doing wrong? Thanks a lot.

1

There are 1 best solutions below

0
user1934428 On

You need to specify /home/josh. A director named ~ does not exist, and tilde expansion does not occur between double quotes. The expansion only occurs at the start of an unquoted word.

alias jupiter="zsh $HOME/Documents/cc3/images/bin/jupiter"

Alternatively you can use a function:

jupiter() {
  zsh ~/Documents/cc3/images/bin/jupiter
}