Bug 1546221 - /etc/profile.d/which2.sh invalid sh syntax
Summary: /etc/profile.d/which2.sh invalid sh syntax
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: which
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Jason Tibbitts
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-16 16:27 UTC by Jason Tibbitts
Modified: 2020-03-25 16:36 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-02-16 17:06:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jason Tibbitts 2018-02-16 16:27:12 UTC
When logging into a rawhide VM, I get the following:

/etc/profile.d/which2.sh:3: = not found

And indeed, line 3 of that script is:

if [ "$0" == ksh ] ; then

which is not valid sh syntax.  It does for whatever reason work in bash, but my login shell is zsh.  You can use the doubled equals sign in the [[...]] form if that's what you prefer, though I don't know anything about how ksh supports that so it's probably best to stick with whatever plain old /bin/test supported.  In that case, just using a single equals sign would be the right move.

Comment 1 Jason Tibbitts 2018-02-16 17:06:27 UTC
Since the fix was trivial, I went ahead and fixed this in rawhide.  I also committed three very minor specfile cleanups; I hope that is OK.  I removed Group:, the buildroot cleaning in %install and the needless %defattr in %files.  Technically the %attr bit in %files is also unneeded (confirmed with rpmdiff) but I left it in.

If you're unhappy with these changes, please feel free to revert them.  I just thought I would save you the time.

Comment 2 Mathieu Chouquet-Stringer 2020-03-25 16:29:59 UTC
Hello,

It's broken again in F32 Beta with rpm version which-2.21-17.fc32.x86_64:

/etc/profile.d/which2.sh:3: = not found

And indeed, line 3 is:
if [ "$0" == "ksh" -o "$0" == "-ksh" ] ; then

Cheers,
Mathieu

Comment 3 Mathieu Chouquet-Stringer 2020-03-25 16:36:07 UTC
I opened BZ#1817138 for it...


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