Avatar of bejhan
bejhan
 asked on

Force gmake to excute under bash instead of sh

How can I force gmake to execute under bash instead of sh?


I have tried entering a bash shell (by typing bash), but gmake still uses sh.
I have tried aliasing sh to bash, same result.
I have tried adding #!/bin/sh to the top of the make file, same result.
Unix OS

Avatar of undefined
Last Comment
bejhan

8/22/2022 - Mon
woolmilkporc

Did you try

export SHELL=/bin/bash

?
bejhan

ASKER
Just tries, doesn't seem to work:

jetha@mustang(inhouse)> gmake
/bin/sh: syntax error at line 1: `(' unexpected
gmake: *** [obj/util/arena.o] Error 2
jetha@mustang(inhouse)> export SHELL=/bin/bash
jetha@mustang(inhouse)> echo $SHELL
/bin/bash
jetha@mustang(inhouse)> gmake
/bin/sh: syntax error at line 1: `(' unexpected
gmake: *** [obj/util/arena.o] Error 2

Open in new window

bejhan

ASKER
After using the truss command to investigate what is going on with gmake, I see that gmake actually executes bin/sh on its own so I do not think there is a way to change the shell used without recompile gmake.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
bejhan

ASKER
I've requested that this question be closed as follows:

Accepted answer: 0 points for bejhan's comment http:/Q_27241012.html#36318519

for the following reason:

Found own solution.
ASKER CERTIFIED SOLUTION
woolmilkporc

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
bejhan

ASKER
You are correct! I was hasty in closing this question.

I see why they call you a genius ;)
woolmilkporc

Since there are two "flavors" of variables in the Makefile, you can also try

SHELL := /bin/bash
export SHELL
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
bejhan

ASKER
Thank you! I have been trying to get this library to compile for days!