The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
plink and shell script praveen.1 Shell Programming and Scripting 5 09-08-2008 02:07 PM
Plink connections to multiple unix servers Moxy Shell Programming and Scripting 2 08-28-2008 09:42 PM
How we can use plink? shekhar_ssm Shell Programming and Scripting 0 03-16-2008 12:35 PM
Trying to retreive and compare value omahablues UNIX for Dummies Questions & Answers 3 03-09-2007 12:14 AM
Plink problem....only works if passwd is in the script Yinzer955i UNIX for Dummies Questions & Answers 3 08-29-2006 01:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-09-2009
Peuj Peuj is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 7
Thumbs down Cannot retreive correct $PATH using PLINK

Hi,

I'm using plink to execute shell script on UNIX machines.
It works pretty well excepted with some machines where I don't have the same $PATH than with putty.

I'm using the command
Code:
PLINK.EXE -ssh machinename -l user -pw password echo $PATH
And for putty nothing special set, I use ssh as connection type.

I'm not a specialist so I'm not sure of the following but it seems that the profile is not load which could explain the difference between the $PATH.

As I don't how works the profile file and I'm not the owner the machines I'm a little lost.

Is there something known with plink? Or something I must set?

Thanks
  #2 (permalink)  
Old 03-11-2009
frozentin frozentin is offline
Registered User
  
 

Join Date: May 2008
Location: Vienna, VA + Bombay, India
Posts: 109
Try:

PLINK.EXE -ssh machinename -l user -pw password ". .profile;echo $PATH"

If this doesn't work, create a file with the above 2 commands in it, and then execute the file.
  #3 (permalink)  
Old 03-12-2009
Peuj Peuj is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 7
Thumbs down

Thanks for the reply.

This doesn't work for me because of missing permissions.

But I've found a solution:
Code:
PLINK.EXE -ssh machinename -l user -pw password bash -l -c 'echo $PATH'
Using bash -l allows me to log on the machine and so load the profile.


Thanks
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0