Bug 63716

Summary: which-2.sh sets alias for all shells (not just for bash)
Product: [Retired] Red Hat Linux Reporter: Jukka Lehti <jukkalehti>
Component: whichAssignee: Than Ngo <than>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-05-05 20:49:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jukka Lehti 2002-04-17 20:17:11 UTC
Description of Problem:

/etc/profile.d/which-2.sh set alias for all shells executing the script, not
just bash. All other scripts under /etc/profile.d set aliases only for bash.

Version-Release number of selected component (if applicable):

which-2.12-3

How Reproducible:

Always.

Steps to Reproduce:
1. Execute the script under ksh/zsh/...

Actual Results:

Alias is set.

Expected Results:

Alias is not set.

Additional Information:
	
Use this script instead:

if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only
# Initialization script for bash and sh
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
fi

Comment 1 Ngo Than 2002-06-14 14:59:45 UTC
It's correct that alias is activated in ksh and zsh.