check shell correctly
This commit is contained in:
parent
1784ef6a01
commit
0811db734b
@ -1,7 +1,7 @@
|
|||||||
Summary: Displays where a particular program in your path is located
|
Summary: Displays where a particular program in your path is located
|
||||||
Name: which
|
Name: which
|
||||||
Version: 2.21
|
Version: 2.21
|
||||||
Release: 30%{?dist}
|
Release: 31%{?dist}
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
|
Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz
|
||||||
Source1: which2.sh
|
Source1: which2.sh
|
||||||
@ -41,6 +41,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
|||||||
%{_mandir}/man1/which.1*
|
%{_mandir}/man1/which.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 02 2021 Than Ngo <than@redhat.com> - 2.21-31
|
||||||
|
- check shell correctly
|
||||||
|
|
||||||
* Tue Oct 26 2021 Than Ngo <than@redhat.com> - 2.21-30
|
* Tue Oct 26 2021 Than Ngo <than@redhat.com> - 2.21-30
|
||||||
- disable the --read-functions option in korn shells
|
- disable the --read-functions option in korn shells
|
||||||
|
|
||||||
|
10
which2.sh
10
which2.sh
@ -1,8 +1,8 @@
|
|||||||
# shellcheck shell=sh
|
# shellcheck shell=sh
|
||||||
# Initialization script for bash, sh, mksh and ksh
|
# Initialization script for bash, sh, mksh and ksh
|
||||||
|
|
||||||
case "$(cat /proc/$$/comm)" in
|
case "$(basename $(readlink /proc/$$/exe))" in
|
||||||
ksh|mksh)
|
*ksh*)
|
||||||
which_declare=""
|
which_declare=""
|
||||||
which_opt=""
|
which_opt=""
|
||||||
;;
|
;;
|
||||||
@ -10,10 +10,14 @@ zsh)
|
|||||||
which_declare="typeset -f"
|
which_declare="typeset -f"
|
||||||
which_opt=""
|
which_opt=""
|
||||||
;;
|
;;
|
||||||
*)
|
bash|sh)
|
||||||
which_declare="declare -f"
|
which_declare="declare -f"
|
||||||
which_opt="-f"
|
which_opt="-f"
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
which_declare=""
|
||||||
|
which_opt=""
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
which () {
|
which () {
|
||||||
|
Loading…
Reference in New Issue
Block a user