B
Bob Smyph
Does anyone know how to access and use the .profile in UNIX while using
NET::SSH in Ruby?
Thanks for the help
NET::SSH in Ruby?
Thanks for the help
Tim said:How to you mean? By updating it, parsing it from the file itself, or by
using finger, or?
Bob said:Does anyone know how to access and use the .profile in UNIX while
using NET::SSH in Ruby?
Thanks for the help
Tim said:Sorry, I got you. I read the post too quickly and for some reason I
thought you said .plan (I should have known that sounded strange).
Indeed, the .profile is only set to work with shell, in the shell env,
which is why CGI, web server APIs/modules and rails don't read it. Did
you need to set any environments or did you want to emulate or somehow
use the shell vars naturally (assuming you can trust the
user's .profile)?
Bob said:I believe we just need to load it into the session/channel so that we
can use access/use command associated with the .profile
We are trying to run a command through Ruby but it seems that we need
certain environmental properties set (e.g. .profile) in order to do
this. If we log onto the server through Putty this command works just
fine.
Does anyone know how to access and use the .profile in UNIX while
using
NET::SSH in Ruby?
Thanks for the help
Bob said:If the only way to get this to work is to set the environment/variables
or emulate them somehow in the Ruby script, that is what we will need to
do. Any idea as how to do this?
You can 'source' the .profile in your ssh session doing a:
cmd=". /home/user/.profile"
note the space after the dot.
Regards.
I believe we just need to load it into the session/channel so that we
can use access/use command associated with the .profile
We are trying to run a command through Ruby but it seems that we need
certain environmental properties set (e.g. .profile) in order to do
this. If we log onto the server through Putty this command works just
fine.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.