I have more than one alias in my .zshrc file, but only one will not resolve.
I can connect using the IP address, but the alias will not work.
I have the same format for all of the computer aliases:
As a note, I have reinstalled the OS, Manjaro 22, and this occurred previously on the same computer.
The other computers on my network has aliases as well and they all work fine.
Why is this happening?
SSH is running fine, NFS is running fine. All aliases are in the .zshrc file.
I have tried different names and i’m only using letters and numbers, no spaces. It seems it must be tied to the IP address for some unfathomable reason.
Two laptops, very similar, an HP Envy and HP Pavillion, one is AMD, the other is Intel, both have Manjaro 22, brand new installs.
I’m not sure if I understand your example.
I assume the space after "ssh " in the parenthesis was a typo?
Are you instructing me to use the alias command to enter my alias entries as opposed to adding my aliases directly in the .zshrc file?
From researching, I was under the impression with the newer versions of Manjaro, those with Zsh as the default shell, aliases were to be added directly into the .zshrc file, so I added them manually in the .zshrc file, i did not use the alias command.
I have read so much conflicting information, but most of it is from people using older versions where bash is still the default shell and from what I have read alias are managed differently.
btw where does the alias command ‘alias’ store the alias information?
Okay, I’ll put my aliases in there, I’ve not seen that option before.
So, name the file config and add my aliases in there. I’ll give it a go.
Okay, so this is baffling.
I have two computers. On one computer, I put my aliases in the .zshrc file and everything works fine.
On the other computer, I used your way with the config file in .ssh and it still will not resolve the IP. This is the same computer that would not resolve the IP in the .zshrc file either. It won’t resolve either way.
as an aside, when I have the aliases in the .zshrc file I can type the ‘alias’ command and they appear in the alias list. if I put them in the .ssh/config file, the aliases do not appear in the alias list.
~ cat .ssh/config ✔
“Read the man page” only works if the man pages are understood by the reader, that’s why we need help. If you see the error in our syntax, just point it out, it would reduce your workload.
btw, I understand what were trying to say now, I cannot use an alias to point at a string, it must be a command (including options). alias string=“command(& options)”
there were way too many usages of the word ‘string’ in the man pages. i thought i could use an IP in place of a command. I hate man pages, but that’s another thread.
Thanks for your help, I honestly would have never figured it out on my own
I figured out my syntax in the ~/.ssh/config.
I was reading an example incorrectly, everything works now.
Please remember, they pay you guys well because you have an attention to detail at a level that most people do not have. I understand you are fighting laziness and ignorance, but you’re fighting the good fight. Laziness and ignorance are terrible afflictions, particular when they are combined.
... An alias definition provides a string value that shall replace
a command name ...
4. Set up nohup so that it can deal with an argument that is itself an
alias nohup="nohup "
So its not possible to use an alias as argument for a command. But you can combine aliases before other arguments.
So this wont work:
But this will work:
alias ssh="ssh "
But as I said above. @andreas85 solution is much better.
I really do appreciate your effort to educate me, I comprehend what you are saying now, but I still cannot wrap my head around how alias ssh='ssh ’ works by simply aliasing ssh and adding a space. I will read further and figure out how this works.
In a nutshell, what had me most confused was that one alias was working fine and it was incorrect too. It led me to believe I was doing it correctly when I actually was not. Why that one alias was working I have no clue.
btw, I did use the solution provided by @andreas85 and it worked.