Bug 63716 - which-2.sh sets alias for all shells (not just for bash)
which-2.sh sets alias for all shells (not just for bash)
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: which (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-17 16:17 EDT by Jukka Lehti
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-05-05 16:49:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jukka Lehti 2002-04-17 16:17:11 EDT
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 10:59:45 EDT
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.