This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pass bash variable as argument to gcc


On Thu, Oct 29, 2015 at 05:57:44AM -0700, staticx wrote:
> I wonder if I can pass the content of a bash variable as an argument to gcc.
> My variable is a list of optimization options like $var="-opt1 -opt2 -opt3"
> gcc $var test.c -o object.o didn't work

Hi

Does 

var="-opt1 -opt2 -opt3" gcc $(env var) test.c -o object.o

work for you?

Bob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]