Welcome to Dream.In.Code
Become an Expert!

Join 149,526 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,461 people online right now. Registration is fast and FREE... Join Now!




Korn shell evaluation

 
Reply to this topicStart new topic

Korn shell evaluation

no2pencil
13 Jun, 2007 - 11:00 AM
Post #1

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,124



Thanked: 76 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
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
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:46PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month