I'm trying to simplify a compilation line for gcc using exapansion variables properties of bash scripting.
Let's say I've defined a variable SRC=src/ containing a folder of source files, and an additional variable C_SOURCES=(source1.c source2.c ...) countaining the source files themselves.
If I write something like "${SRC}${C_SOURCES[@]}", the result is that only the first value in the C_SOURCES variable gets the value in SRC, so: src/source1.c source2.c .... Which is not what I expected.
How should I rewrite the line with variable expansion so all values in C_SOURCES variable get the value in SRC variable?
source 2.cwill be two different elements in the array unless you quote it