Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10724 - app-shells/zsh-4.0.6-r2 global startup files
Summary: app-shells/zsh-4.0.6-r2 global startup files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: phoen][x
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-14 03:42 UTC by James Michael Fultz
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
zshenv (zshenv,318 bytes, text/plain)
2002-11-14 04:18 UTC, James Michael Fultz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Michael Fultz 2002-11-14 03:42:44 UTC
I hope to help solve two problems I've encountered and am sure affects other
Gentoo Linux and Zsh users. One is that Zsh doesn't incorporate the setup from
env.d without adding some code for it to my local startup files.  The other is
that the files `zshenv', `zshrc', and `zlogin' in the directory `/etc/zsh'
should not be installed as global startup files.  They are only meant as
examples and are commented as such.  The following line is taken from
`/etc/zsh/zshenv':

# THIS FILE IS NOT INTENDED TO BE USED AS /etc/zshenv, NOR WITHOUT EDITING

Both `zshrc' and `zlogin' bear similar comments.

My suggestion is that these three files not be installed, but rather the
following `zshenv' I've created be used instead:

--- Begin zshenv ---
if [[ -o rcs ]]
then
	if [[ -e "/etc/profile.env" ]]
	then
		  source /etc/profile.env
	fi

	#077 would be more secure, but 022 is generally quite realistic
	umask 022

	if [[ $(/usr/bin/whoami) == 'root' ]]
	then
		export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
	else
		export PATH="/bin:/usr/bin:${PATH}"
	fi
	unset ROOTPATH
fi

--- End zshenv ---

Since Zsh is a superset of the POSIX and Bourne shells, I used `/etc/profile' as
template.  I've tested this file on my system and have had no problems.
Comment 1 James Michael Fultz 2002-11-14 04:18:24 UTC
Created attachment 5658 [details]
zshenv

I later made some minor improvements in `zshenv'.  Perhaps increasing
efficiency the tiniest amount, but mostly improving readability by reducing the
level of indent.
Comment 2 phoen][x 2002-11-15 10:03:14 UTC
Eek, now who put these files into /etc/zsh in the first place?

I removed zshrc and zshlogin and replaced zshenv with your version.
Works pretty well here, thanks for the contribution James.

-phoen][x-