|
Ok, this one is driving me crazy, because I swear I've done this before & I can't find squat on google. Maybe I'm not feeding google what it wants.
So, say I need to use sudo to ssh off the box. However, within the commands I need to run on the target box, I will have a variable. Once the sudo ssh is on that box, the variable will no longer exist, so how can I evaluate the variable prior to ssh connection with that box?
sudo -u user ssh ${targetbox} -l user 'command | grep ${args}' 2>/dev/null
...will return "not enough args for grep", however if I echo the line, I get what I'm looking for. So therefor, the variable ${args} doesn't exist once I'm ssh connected to ${targetbox}.
***************Never mind****************
It's an issue with using double quotes instead of single.
This post has been edited by no2pencil: 13 Jun, 2007 - 11:13 AM
|