Bug 63716 - which-2.sh sets alias for all shells (not just for bash)
Summary: which-2.sh sets alias for all shells (not just for bash)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: which
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-04-17 20:17 UTC by Jukka Lehti
Modified: 2007-04-18 16:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-05-05 20:49:38 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.