Bug 1195102 - fish doesn't set the SHELL environment variable
Summary: fish doesn't set the SHELL environment variable
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: fish
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Andy Lutomirski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-23 01:37 UTC by Raphael Groner
Modified: 2015-02-23 15:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-23 15:34:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1189036 0 unspecified CLOSED RFE: ccache should get applied via profile in other shells than bash 2022-08-03 18:07:13 UTC

Internal Links: 1189036

Description Raphael Groner 2015-02-23 01:37:37 UTC
Description of problem:
Shebang is script files does not seem to care for fish. I have /bin/sh as a symlink to bash. When fish executes a script, it does not call the shell from the shebang comment line.

Version-Release number of selected component (if applicable):
fish-2.1.1-2.fc21.x86_64
rpm-build-4.12.0.1-4.fc21.x86_64

How reproducible:
yes

Steps to Reproduce:
1. install rpmbuild
2. /usr/lib/rpm/find-lang.sh $foo --with-qt

Actual results:
failure

Expected results:
no failure

Additional info:
$ head -1 /usr/lib/rpm/find-lang.sh
#!/bin/sh

Severity high cause it may confuse people heavily.

Comment 1 Raphael Groner 2015-02-23 01:39:54 UTC
Unfortunately, fish is known to not be compatible to POSIX, neither bourne nor c shell.

Comment 2 Andy Lutomirski 2015-02-23 01:55:12 UTC
Can you clarify?  Shebangs are parsed by the kernel, not the shell.

Comment 3 Raphael Groner 2015-02-23 11:03:13 UTC
Try this in a script:

#!/bin/bash
echo "a $SHELL"
fish -c 'echo "b $SHELL"'

I think the output should be for both fish and bash as the login shell and caller each then of the script:

a bash
b fish

But fish enforces to set $SHELL in both cases:

a fish
b fish

For "su -l" I get for root shell:

a /bin/bash
b /bin/bash

Comment 4 Andy Lutomirski 2015-02-23 15:34:16 UTC
I did an experiment:

$ env -i bash -c 'echo $SHELL'
/bin/bash
$ env -i sh -c 'echo $SHELL'
/bin/bash
$ env -i /sbin/busybox sh -c 'echo $SHELL'

$ env -i fish -c 'echo $SHELL'

$ env -i csh -c 'echo $SHELL'
SHELL: Undefined variable.

$ env -i dash -c 'echo $SHELL'


It appears that bash is the odd one out here.

If there is an actual problem, please reopen.


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