[21376] in Athena Bugs

home help back first fref pref prev next nref lref last post

PATH wrong on dialup with Bash

daemon@ATHENA.MIT.EDU (Stephen Gildea)
Wed Jan 29 09:14:49 2003

Message-Id: <200301291414.JAA10765@no-knife.mit.edu>
To: bugs@MIT.EDU
cc: gildea@MIT.EDU
Date: Wed, 29 Jan 2003 09:14:47 -0500
From: Stephen Gildea <gildea@MIT.EDU>

When I ssh to a dialup machine, my PATH begins (incorrectly) with
a colon.  When I login to a campus workstation, PATH is correct
(without a leading colon).

I use Bash as my login shell.  The dialup is running Athena 9.1.22.

I believe the problem may be this fragment at line 138 of
/usr/athena/lib/init/bashrc (version 1.25):

	# Standard Athena path
	PATH=`/usr/athena/bin/athdir $HOME`:$athena_path:.
	unset athena_path

If athdir returns nothing for $HOME, the resulting expansion
incorrectly prepends a colon.  Better would be this:

	# Standard Athena path
	athena_home_bin=$(/usr/athena/bin/athdir "$HOME")
	PATH=${athena_home_bin:+$athena_home_bin:}$athena_path:.
	unset athena_path athena_home_bin

home help back first fref pref prev next nref lref last post