ihsec icon indicating copy to clipboard operation
ihsec copied to clipboard

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

Open IVXCVI opened this issue 7 years ago • 5 comments

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 avatar May 23 '18 06:05 IVXCVI

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.

a-hausmann avatar Jun 24 '18 19:06 a-hausmann

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

Compro-Prasad avatar Aug 13 '18 08:08 Compro-Prasad

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

a-berg avatar Jan 31 '21 14:01 a-berg

@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: https://github.com/daedreth/ihsec/pull/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.

SamuelBanya avatar May 13 '22 03:05 SamuelBanya

Thanks! I was too timid to create a PR. Good for you!Sent via the Samsung Galaxy S9+, an AT&T 5G Evolution capable smartphone -------- Original message --------From: SamuelBanya @.> Date: 5/12/22 11:19 PM (GMT-05:00) To: daedreth/ihsec @.> Cc: Arnold Hausmann @.>, Comment @.> Subject: Re: [daedreth/ihsec] Install fails spectacularly with both zhshell & bash (Debian 9.4) (#7) @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.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

a-hausmann avatar May 13 '22 22:05 a-hausmann