Re: pass bash variable as argument to gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29/10/2015, 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

Because that's not how you set shell variables.

It should be var="..." not $var="..."

This has nothing to do with GCC, you're just using the shell wrong.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux