How to Enable Alias Command on Remote Machine Using SSH
Hi,
I basically want to run my alias commands on a remote machine via SSH. So, if I do this, ssh test_machine "find_me" (where find_me is an alias command), it will give me this error. ksh: find_me: not found How do I solve this? |
Quote:
|
Hi Count Zero,
Yes, the command has been alias on the remote machine. So, if I log to the remote machine and I ran "find_me", then it will perform the command. What I want is to run the command: ssh test_machine find_me, and it will run the command without me needing to log to the machine anymore. This is like if I type ssh test_machine ls, it will list the files but this isn't a problem because ls is not an alias command. Does it make sense? |
Quote:
For example, bash reads ~/.bashrc when opened as an interactive non-login shell, but it reads ~/bash_profile instead if it's ran as a login shell. Read "man bash" for complete info. I don't know anything about ksh, but "man ksh" or "info ksh" probably have some tips on this. Alternatively, you can try to rewrite them as functions or scripts if that doesn't hepl. |
Hi i92guboj,
So, if the remote machine uses bash. And I put the alias command in .bashrc, then theoretically it should work (ssh to the remote machine and run an alias command), right? Is this what you mean? |
Quote:
|
Hi i92guboj,
Can you give an example of rewriting the alias as a function? Thanks. |
Quote:
For example, if you have this alias: Code:
alias ll='ls -l' Code:
function ll () { |
All times are GMT -5. The time now is 02:48 AM. |