Sponsored Content
Top Forums Shell Programming and Scripting [bash] command line substitution with environmental variables Post 302401391 by vivekraj on Friday 5th of March 2010 11:52:42 PM
Old 03-06-2010
Hi ASGR,it is simple.You try this,
Code:
 
FLAGS[0]="CFLAGS=\"-arch x86_64 -g -Os -pipe -no-cpp-precomp\"" 
FLAGS[1]="LDFLAGS=\"-arch x86_64 -bind_at_load\""  
echo ${FLAGS[0]} ${FLAGS[1]}

The above is the example code for your understanding.

If you have more number of strings in an array,you use for loop like below.

Code:
FLAGS[0]="CFLAGS=\"-arch x86_64 -g -Os -pipe -no-cpp-precomp\"" 
FLAGS[1]="LDFLAGS=\"-arch x86_64 -bind_at_load\""  
for((i=0;i<${#FLAGS[@]};i++))
do
echo -n "${FLAGS[$i]} "
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Environmental Variables - where stored ?

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)
Discussion started by: DGoubine
5 Replies

2. UNIX for Dummies Questions & Answers

Unix passing environmental Variables

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)
Discussion started by: belfastbelle
7 Replies

3. AIX

Best way to setup my own environmental variables ?

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)
Discussion started by: Browser_ice
4 Replies

4. Shell Programming and Scripting

Oracle environmental variables in shells script

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)
Discussion started by: milink
3 Replies

5. Shell Programming and Scripting

bash, command line substitution

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)
Discussion started by: skippyV
10 Replies

6. Shell Programming and Scripting

Help with manipulating environmental variables in UNIX

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)
Discussion started by: jclanc8
1 Replies

7. OS X (Apple)

Don't understand the practical difference between command aliases and environmental variables

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)
Discussion started by: scrutinizerix
3 Replies

8. Shell Programming and Scripting

How to Force command substitution evaluation in bash?

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)
Discussion started by: siegfried
0 Replies

9. Shell Programming and Scripting

How to Force command substitution evaluation in bash?

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)
Discussion started by: siegfried
15 Replies

10. Shell Programming and Scripting

<< Environmental Variables are not set when script completes >>

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)
Discussion started by: kamauv234
2 Replies
GStreamer(1)						      General Commands Manual						      GStreamer(1)

NAME
gst-xmllaunch - build and run a GStreamer pipeline from an XML serialization SYNOPSIS
gst-xmllaunch [OPTION...] XML-FILE [ ELEMENT.PROPERTY=VALUE ... ] DESCRIPTION
gst-xmllaunch is a tool that is used to build and run a basic GStreamer pipeline, loading it from an XML description. You can produce the XML description using gst-launch-0.10(1) with the -o option or by calling gst_xml_write_file() in your own app. A simple commandline looks like: gst-xmllaunch my-pipeline.xml filesrc0.location=music.mp3 This sets the location property of the element named filesrc0 to the value "music.mp3". See gst-launch(1) for syntax on setting element names, and gst-inspect to see what properties various elements have. You can pass "-" as the XML-FILE to read from stdin. XML-FILE can be a URI as well, thanks to the wizardry of libxml. I'm not really sure what all is supported, it seems http works just fine though. OPTIONS
gst-xmllaunch accepts the following options: --help Print help synopsis and available FLAGS --silent Do not output status information --exclude=TYPE, -XTYPE Do not output status information of TYPE --output=FILE, -oFILE Save XML representation of pipeline to FILE and exit --gst-info-mask=FLAGS GStreamer info flags to set (list with --help) --gst-debug-mask=FLAGS GStreamer debugging flags to set (list with --help) --gst-mask=FLAGS GStreamer info and debugging flags to set (list with --help) --gst-plugin-spew GStreamer info flags to set Enable printout of errors while loading GStreamer plugins --gst-plugin-path=PATH Add directories separated with ':' to the plugin search path SEE ALSO
gst-feedback(1), gst-inspect(1), gst-launch(1), gst-typefind(1) AUTHOR
The GStreamer team at http://gstreamer.freedesktop.org/ March 2001 GStreamer(1)
All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy