From owner-freebsd-ports Wed May 10 00:23:18 1995 Return-Path: ports-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA11638 for ports-outgoing; Wed, 10 May 1995 00:23:18 -0700 Received: from ghpc6.ihf.rwth-aachen.de (ghpc6.ihf.RWTH-Aachen.DE [134.130.90.6]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id AAA11626 for ; Wed, 10 May 1995 00:23:12 -0700 Received: (from thomas@localhost) by ghpc6.ihf.rwth-aachen.de (8.6.8/8.6.6) id JAA23932; Wed, 10 May 1995 09:21:53 +0200 From: Thomas Gellekum Message-Id: <199505100721.JAA23932@ghpc6.ihf.rwth-aachen.de> Subject: Re: pdksh errors - Solved! To: wsantee@wsantee.oz.net (Wes Santee) Date: Wed, 10 May 1995 09:21:52 +0200 (MET DST) Cc: freebsd-ports@FreeBSD.org In-Reply-To: <199505100613.XAA06332@wsantee.oz.net> from "Wes Santee" at May 9, 95 09:34:00 pm Organization: Institut f. Hochfrequenztechnik, RWTH Aachen X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1220 Sender: ports-owner@FreeBSD.org Precedence: bulk Wes Santee wrote: > > Well, I dunno if anybody has any interest in this, but I solved my > earlier problem of pdksh crapping out whenever I tried to run > /usr/bin/clear. The error was in the global /etc/ksh.kshrc file. > Here is the culprit: > > HOSTNAME=${HOSTNAME:-`uname -n` > HOST=${HOSTNAME%%.*} <--- error Now that you're saying it... > Incidentally, you may recall that the original error was: > > /usr/bin/clear: 21: syntax error: bad substitution > > Well, I'll leave it to the reader to figure out what line number the > offending statement was in the /etc/ksh.kshrc file. :) pdksh sets ${ENV} to /etc/ksh.kshrc. /bin/sh reads ${ENV}. Obviously a POSIX thing. /bin/sh doesn't know anything about the %% substitution so it gives an error message when it tries to execute /usr/bin/clear. You will notice that /etc/profile (the one from the ksh distribution) contains a test for the interpreter (something like `if [ $RANDOM != $RANDOM ] we're ksh else a bourne shell'; sorry, memory's the first thing to go). I think I guarded /etc/ksh.kshrc in a similar manner. Maybe I should add my changes to the port and install the dot-files somewhere (/etc? /usr/share/skel?). tg