Link to home
Start Free TrialLog in
Avatar of pfox74
pfox74

asked on

Setting Default Path tht will stay after reboot

I have a SCO Unix (5.0.4) installation and need to know how to define the default paths.  I can set the path using the PATH= command but would like to know how to set a path that will stay after reboot and be available to all users without adding it to each individual profile.

Thanks for your help
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Hi,

you may set it in /etc/profile

Avatar of pfox74
pfox74

ASKER

Do I enter the normal PATH command or is there some special syntax?

Thanks
As you set it in .profile


e.g.

PATH=/usr/bin

export PATH
Avatar of pfox74

ASKER

That seems to be causing errors.  I've attached the current profile  ... any idea where I might add the new path  /scripts?

Thanks
#!/bin/sh
# The following was generated from 
# NLS/en/adm.gen
#
MF_ADM=adm.cat@Unix
#
MS_PROFILE=1
MSG_MAIL=1
:
#	@(#) profile.sh 26.1 95/07/25 
#
#	Copyright (C) 1988-1995 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#
 
#ident	"@(#)adm:profile	1.10"
 
trap "" 1 2 3
umask 022
 
case "$0" in
-sh | -rsh | -ksh | -rksh)
 
# if not doing a hushlogin, issue message of the day, if the file is out there
	[ "X$HUSHLOGIN" != "XTRUE" ] && [ -s /etc/motd ] && {
		trap : 1 2 3
		echo ""		# skip a line
		cat /etc/motd
		trap "" 1 2 3
	}
 
# setting default attributes for terminal moved to ~/.profile, so
# each user has individual control over these characteristics
 
# if not doing a hushlogin, check mailbox and news bulletins
	if [ "X$HUSHLOGIN" != "XTRUE" ]
	then
		[ -x /usr/bin/mail ] &&	{	# if the program is installed
			[ -s "$MAIL" ] && \
				dspmsg $MF_ADM -s $MS_PROFILE $MSG_MAIL '\nyou have mail\n'
		}
		if [ "$LOGNAME" != "root" -a -x /usr/bin/news ]	# be sure it's there
		then news -n
		fi
	fi
	;;
-su)
	:
	;;
esac
 
trap 1 2 3

Open in new window

ok

You may add it after line 23, but please note the following:

To preserve previous value of PATH since many commands depend on it, use

PATH=$PATH:/new/path

where /new/path is your actual path you want to add.
Avatar of pfox74

ASKER

No errors this time but it also didn't create the mapping.  do I need to reboot to apply this change?  I did but just curious if it was neccessary.

thanks
No not required, only logout / login again.
Hi,

If it did not give you the new  PATH as you set it, can you tell the type of login shell used by you?

The content of your .profile (if you use sh / ksh ) or .login (if you use csh or tcsh)?

Avatar of pfox74

ASKER

It's SH  I've attached the .profile.


:
#	@(#) root.profile 26.1 95/09/18 
#
#	Copyright (C) 1989-1995 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#
 
SHELL=/bin/sh
HOME=/
PATH=/bin:/etc:/usr/bin:/tcb/bin:/usr/local/bin:/usr/trufax/bin
 
# set terminal type
eval `tset -m ansi:${TERM:-ansi} -m :\?${TERM:-ansi} -e -r -s -Q`
export TERM PATH SHELL HOME
 
[ -x /bin/mesg ] && mesg n		# if mesg is installed...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pfox74

ASKER

Thanks, that did it!  Grade A work!