From owner-freebsd-questions Tue May 27 05:06:18 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA10162 for questions-outgoing; Tue, 27 May 1997 05:06:18 -0700 (PDT) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA10148 for ; Tue, 27 May 1997 05:06:14 -0700 (PDT) Received: by mail.EUnet.hu, id OAA18640; Tue, 27 May 1997 14:05:58 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id LAA00507; Tue, 27 May 1997 11:44:12 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199705270944.LAA00507@CoDe.hu> Subject: Re: rsh/ksh problems To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Tue, 27 May 1997 11:44:12 +0200 (MET DST) Cc: nirva@ishiboo.com, msmith@revolution.3-cities.com In-Reply-To: <19970527092216.9143.qmail@dot.ishiboo.com> from "nirva@ishiboo.com" at "May 27, 97 03:22:15 am" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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"