Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 May 1997 11:44:12 +0200 (MET DST)
From:      Zahemszky Gabor <zgabor@CoDe.hu>
To:        freebsd-questions@freebsd.org (FreeBSD questions)
Cc:        nirva@ishiboo.com, msmith@revolution.3-cities.com
Subject:   Re: rsh/ksh problems
Message-ID:  <199705270944.LAA00507@CoDe.hu>
In-Reply-To: <19970527092216.9143.qmail@dot.ishiboo.com> from "nirva@ishiboo.com" at "May 27, 97 03:22:15 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> > I have the .rhosts file properly created.
> > 
> > when i say "rsh machine2 ls" I get the output from ls.  OK, fine.  Now
> > I say "rsh machine2 rmt" and it says ksh: rmt: not found.  Hmm,
> > now I say "rsh machine2 set" and I get the path as being 
> > PATH='/usr/bin:/bin'.  For some reason, the remote ksh is not picking
> > up the path in /etc/profile or $HOME/.profile.  Am I doing something
> > wrong here?  How do I get the remote ksh to pick up the path that I 
> > need?
> 
> Your .profile doesn't get read when you run a shell through rsh
> because the shell isn't started as a login shell. You need to set the
> PATH in the non-login rc file... I'm not sure what it is for ksk.

Well, ksh's non-login file hasn't got a real name.  (Most of the time it's
$HOME/.kshrc, but YMMV.)  The name is coming from
the ENV environment variable, settable in /etc/profile or ~/.profile - but
they weren't read.  Catch22.
So the solution is use absolute pathnames, like:
rsh machine2 /etc/rmt
or
rsh machine2 /usr/sbin/rmt
or I don't know, which is the path of rmt in your machine2.

Bye, Gabor

-- 
#!/bin/ksh
Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705270944.LAA00507>