How can I invoke the bash shell (via command line) to execute another command by setting an exported environmental variable on the fly (as this env var would be used by the command -another script, the bash would execute).
This needs to be done in one single line as the same would go into a make file to build something.
/bin/bash -c "" seems to work; though I had tried in simple tests and were expecting that ps -aef | grep bash would show another bash. Guess it just executes and goes off.
To give the context, I was looking for this is that we have a make file which calls for autoconf ./configure along with some arguments for the configure script (in a single line). This by-default looks for the gcc compiler where as I want the configure script to take IBM's xlc compiler (my platform being an AIX machine). Somewhere, I came to know that the configure scripts would look for exported value of CC to decide on the compiler to be used in the makefile generated by it.
Hence, I needed to call bash before ./configure and set the environment var CC for the path of the xlc (on the same line); this was to me without luck and made me to look for your help.
Thanks, I'll try once again tomorrow morning and would update across.