1
I'm trying to execute a remote command using ssh.
I need the shell that executes the command to load .bashrc, so so far i've learned that i can use bash -lc
for that. the problem is that it allows me to execute a command but ignore it's arguments
In general i want to run pm2 (Production process manager for Node.js) with a list parameter to show me the available running tasks.
when I execute
ssh ufk@10.0.0.3 bash -lc pm2 list
or
ssh ufk@10.0.0.3 bash -lc "pm2 list"
I get the same results. it executes the application as if i didn't provide any arguments at all.
here i provided the argument 'list' to pm2.
any ideas?
You need a combination of strong and weak quotes around your bash statement.
ssh ufk@10.0.0.3 "bash -lc 'pm2 list'"
– fd0 – 2015-08-04T10:29:11.100