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)
Product: Red Hat Linux
Classification: Retired
Component: which (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Aaron Brown
Depends On:
  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:
Last Closed: 2002-05-05 16:49:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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):


How Reproducible:


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'
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.