Link to home
Start Free TrialLog in
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.
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Did you try

export SHELL=/bin/bash

?
Avatar of bejhan
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

Avatar of 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.
Avatar of 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
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bejhan

ASKER

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

I see why they call you a genius ;)
Since there are two "flavors" of variables in the Makefile, you can also try

SHELL := /bin/bash
export SHELL
Avatar of bejhan

ASKER

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