[bash] command line substitution with environmental variables
Hi,
I'm using an array that contains compiler FLAGS
that need to be executed either before ./configure
or after the main 'make' command.
example of array containing compiler flags.
-------------------------------------------------
To get the output:
CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" LDFLAGS="-arch x86_64 -bind_at_load" ./configure
Unfortunately, when I try to use the usual substitution
$(${FLAGS[@]}), it seems to terminate after the first
space following the -arch option:
CFLAGS="-arch: command not found
I've tried a number of combinations but not been able
to find a conclusive solution. Any help or ideas would
be appreciated.
I've realised that what I'm trying to do is to define
the flag variables before ./configure is executed on
the same line which I've been told is the most recent
method.
Essentially, it's the same process as typing it on the
command line, but all the variables and commands
are held in variables.
On-the-fly or dynamic seems to be appropriate words
to describe what I'm trying to do.
Just to nail the lid shut on this one, I'd like
to use it through a function as below, but a
straight translation from the previous post
to one that uses eval in a function seems to
generate a 'command not found' error.
use: array_eval FLAGS
Any help would be appreciated.
Hi Team,
I have a wrapper script which i have pasted below, it internally calls one python script to generate Environmental in a file called /home/oracle/myenv.sh, when i execute this script via wrapper script, its not reflecting in my current session, still showing old env variables. any... (2 Replies)
OK, I'm striving to abide by all the rules this time.
Here is a fragment of my windows10/cygwin64/bash script:
export BUPLOG=$(BackupRecords --log "$src")
robocopy $(BackupRecords -mrbd "$src" --path "$src") $(BackupRecords --appSwitches "$src") "$src" "$dst" $(BackupRecords --fileSwitches... (15 Replies)
OK, I'm striving to abide by all the rules this time.
Here is a fragment of my windows10/cygwin64/bash script:
export BUPLOG=$(BackupRecords --log "$src")
robocopy $(BackupRecords -mrbd "$src" --path "$src") $(BackupRecords --appSwitches "$src") "$src" "$dst" $(BackupRecords --fileSwitches... (0 Replies)
Hey,
I'm recently learning Unix from the video course by Kevin Scoglund. I'm stuck at the moment where he goes into Environmenat variables. I have some issues with understanding what's the essential difference between EV and command aliases: for instance, by writing the command
alias ll='ls... (3 Replies)
I am wondering if there is away to increment a date in c shell. What I need to do is basic, but I lack the knowledge.
I have they following environmental variable in my job scripts
setenv YYYY `date '+%Y'`
I then set YYYY to be part of my output dataset name:
setenv dd_OUTPUTP... (1 Reply)
I have one script calling another with a set of strings that includes white space. Script A calls Script B with these input strings: one two "th ree"
Script B pulls apart the arguments correctly:
arg0 = one, arg1 = two, arg2 = "th ree"
if I call it from within Script A like so:... (10 Replies)
Hi,
Getting below error on executing the shell script which initiates sqlplus
How to set oracle enviornment variables in the shell script ?
With Regards (3 Replies)
I am writing a few korn scripts to be used by all our operators on several 4.1/4.2 AIX servers.
I want to create environmental variables that once set, can be read/modified by my scripts (ex: specific folders, file names, conventions, general values, ...). I thought this would be better then... (4 Replies)
In my script when I change an env variable in the parent shell it is only changed for that session - it there away to change it permanently using a script so that when I use rlogin (create a child session) that the env variable is set correctly?
Basically what I am trying to do is to pass a... (7 Replies)
Hi all !
Yesterday I defined an environmental variable PATH, but today when I restarted machine, I could not see that it was stored any place.
Is there any file where I could save the settings ?
I have quite a few env.variables defined, so I need a smarter way to define.
regards
D (5 Replies)