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
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
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
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of bejhan
bejhan

ASKER

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

I see why they call you a genius ;)
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

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

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

ASKER

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

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.

33K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo