SSH with Command Doesn't Run as an Alias

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have the following command to remote into a local server and tail -f the latest log file for an application that I have.
The command works perfectly fine from the command line -
ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'
The problem is that when I make it an alias (or even a function), it evaluates the completion of the ls -1r on my local machine and tries to pass that to the remote machine.
alias latestbotlogs="ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'"
function latestbotlogs head -1)'
What syntax do I need to use such that the entire command gets evaluated on the remote machine that I am accessing via SSH.
Thanks in advance!
bash ssh alias
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
I have the following command to remote into a local server and tail -f the latest log file for an application that I have.
The command works perfectly fine from the command line -
ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'
The problem is that when I make it an alias (or even a function), it evaluates the completion of the ls -1r on my local machine and tries to pass that to the remote machine.
alias latestbotlogs="ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'"
function latestbotlogs head -1)'
What syntax do I need to use such that the entire command gets evaluated on the remote machine that I am accessing via SSH.
Thanks in advance!
bash ssh alias
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have the following command to remote into a local server and tail -f the latest log file for an application that I have.
The command works perfectly fine from the command line -
ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'
The problem is that when I make it an alias (or even a function), it evaluates the completion of the ls -1r on my local machine and tries to pass that to the remote machine.
alias latestbotlogs="ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'"
function latestbotlogs head -1)'
What syntax do I need to use such that the entire command gets evaluated on the remote machine that I am accessing via SSH.
Thanks in advance!
bash ssh alias
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have the following command to remote into a local server and tail -f the latest log file for an application that I have.
The command works perfectly fine from the command line -
ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'
The problem is that when I make it an alias (or even a function), it evaluates the completion of the ls -1r on my local machine and tries to pass that to the remote machine.
alias latestbotlogs="ssh user@hostname 'tail -f $(ls -1r ~/Development/python/twitter-bot/logs/*.log | head -1)'"
function latestbotlogs head -1)'
What syntax do I need to use such that the entire command gets evaluated on the remote machine that I am accessing via SSH.
Thanks in advance!
bash ssh alias
bash ssh alias
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 min ago
mattdonders
1012
1012
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
mattdonders is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
mattdonders is a new contributor. Be nice, and check out our Code of Conduct.
mattdonders is a new contributor. Be nice, and check out our Code of Conduct.
mattdonders is a new contributor. Be nice, and check out our Code of Conduct.
mattdonders is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477802%2fssh-with-command-doesnt-run-as-an-alias%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password