Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails spectacularly with both zhshell & bash (Debian 9.4) #7

Open
IVXCVI opened this issue May 23, 2018 · 5 comments
Open

Install fails spectacularly with both zhshell & bash (Debian 9.4) #7

IVXCVI opened this issue May 23, 2018 · 5 comments

Comments

@IVXCVI
Copy link

IVXCVI commented May 23, 2018

Hello! I'm watching your very helpful videos on emacs & came across the one you made on ihsec. I'm very much looking forward to using it--however--I appear to have run into a rather bizarre-looking issue.

I've cloned into a fresh directory two directories down from home: e.g. ~/Source/git/(new dir)

Running sudo make spits out the following:

if [[ "STYPE" == "darwin"* ]]; then cp ihsec.sh /usr/local/bin/ihsec; chmod 755 /usr/local/bin/ihsec; else install -D -m 755 ihsec.sh /usr/local/bin/ihsec; fi
/bin/sh: 1: [[: not found

I have yet to look more closely at the script. I'll return with any findings (I'm just beginning to learn bash scripting, so I may or may not notice what's causing this). Cheers!

@IVXCVI IVXCVI changed the title Install fails spectacularly in with both zhshell & bash (Debian 9.4) Install fails spectacularly with both zhshell & bash (Debian 9.4) May 23, 2018
@a-hausmann
Copy link

a-hausmann commented Jun 24, 2018

I got the same error using Ubuntu 18.04. The key to the error is "/bin/sh:", which shows the make is utilizing the Bourne shell instead of bash, and the "[[ ... ]]" construct is a bash construct.
I was able to fix this by changing the Makefile to read:
if [ "$OSTYPE" = "darwin"*];then cp ihsec.sh /usr/local/bin/ihsec;
etc., etc., for the remainder of the line.
This worked well.

@Compro-Prasad
Copy link

Same here. I would suggest to use install.sh instead of a Makefile.

@a-berg
Copy link

a-berg commented Jan 31, 2021

The error comes because by default GNU Make uses /bin/sh. Setting the SHELL variable inside the makefile to point to /bin/bash does the trick. Someone should make a PR for it.

SHELL := /bin/bash

@SamuelBanya
Copy link

@a-berg
Big time Uncle Dave fan here. Thanks for the idea for my first PR ever on a public repo :)

I made the changes here:
#12

I think at this point then Dave needs to then just approve it to have it merged to master. After doing this revision, I was able to have Make resolve the related environment variable to the correct path ('/usr/local/bin') on my Thinkpad running Manjaro.

@a-hausmann
Copy link

a-hausmann commented May 13, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants