Sponsored Content
Full Discussion: Variable variables
Top Forums Shell Programming and Scripting Variable variables Post 302790439 by Corona688 on Friday 5th of April 2013 11:17:05 AM
Old 04-05-2013
A modern shell will let you dereference a string with ${!...}

You must assign the string first, you can't embed the string inside the {}

Code:
STR="${MONTH}_${DAY}_${YEAR}"

echo "${!STR}"

This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extract from string variable into new variables

I have a variable which consists of a string like this: 001 aaabc 44 a bbb12 How do I extract each substring, delimited by the spaces, into new variables - one for each substring? eg var1 will be 001, var2 will be aaabc, var3 will be 44, var4 will be a, etc? I've come up with this:... (2 Replies)
Discussion started by: Sniper Pixie
2 Replies

2. Shell Programming and Scripting

how to seperate a variable in 2 variables

Dear all, i dont know how to split one variable value in 2 variable. please send me any example. variable1= "abcde developer" now i want to seperate the values and seperator is space. (6 Replies)
Discussion started by: intikhabalam
6 Replies

3. Shell Programming and Scripting

moving variables to another variable as a new avriable

Somehow I can't get it for this basic bash problem. maybe someone can help. What I try to do is: a="world" b="hello" how can I move this into $c so that I can replace "helloworld" with "world hello" in sed like: sed "s/\helloworld/ ${c}... I tried several combinations but all with... (4 Replies)
Discussion started by: lowmaster
4 Replies

4. Shell Programming and Scripting

Bash:How to split one string variable in two variables?

Hello, I have a paramter $param consisting just of two literals and want to split it into two parameters, so I can combine it to a new parameter <char1><string><char2>, but the following code didn't work: tmp_PARAM_1=cut -c1 $PARAM tmp_PARAM_2=cut -c2 $PARAM... (2 Replies)
Discussion started by: ABE2202
2 Replies

5. Shell Programming and Scripting

Combining multiple variables into new variable

Hello, I am a new joiner to the forum, and have what i hope is a simple question, however I can't seem to find the answer so maybe it is not available within bash scripting. I intend to use the below script to archive files from multiple directories at once by using a loop, and a variable (n)... (10 Replies)
Discussion started by: dring
10 Replies

6. Shell Programming and Scripting

Refering to compound variables with a variable name

Hello, Here is my problem using KSH I have a set of compound variables, let say cmp_var1 cmp_var2 The names of these variables are stored in an indexed array. How can I access the subfields of these compound variables ? I tried: set -A cmp_varnames=(cmp_var1 cmp_var2) for cmp in... (4 Replies)
Discussion started by: luky55
4 Replies

7. Shell Programming and Scripting

How to set a variable name from another variables value?

Experts, I want to set value of variables like this in bash shell: i=5 ; L=100 I want variable d5 (that is d(i) ) to be assign the value of $L , d$i=$L ; echo $d5 Not working Thanks., (3 Replies)
Discussion started by: rveri
3 Replies

8. Shell Programming and Scripting

Setting a variable using variables in a loop

Hi, I am having a bit of trouble with the below code: file=/path/to/file for i in 03 06 07 21; do if ; then eval count$i=`grep -c word $file-$i` fi done Totalcount=0 for i in 03 06 07 21; do if ; then echo $count$i variable not exist; else Tcount=`expr $Tcount + $count$i`; fi... (3 Replies)
Discussion started by: brunlea
3 Replies

9. Shell Programming and Scripting

Concatenate two variables and form the third variable

Hi Guys, I was scratching my head for this for half a day... finally not successful :confused: Following is the problem I have a variable $ var1=123 $ var2-234 $ var3=345 and another Variable $ i=1 Now i wanted to save these into a Variable as shown below for i in 1 2 3 do... (5 Replies)
Discussion started by: ramprabhum
5 Replies

10. UNIX for Beginners Questions & Answers

Expand Variables and Wildcards into another variable.

Dear Forum members, I am having trouble getting the complete filename (and directory path) in a variable. Output directory mentioned in the code have three files: DISPLAY_CITY_DETAILS_15-05-2019-08-29-26_MIGRATE_london.out DISPLAY_CITY_DETAILS_15-05-2019-08-29-26_MIGRATE_paris.out... (4 Replies)
Discussion started by: chetanojha
4 Replies
SUMO(1) 							   User Commands							   SUMO(1)

NAME
SUMO - Importer of polygons and POIs for the road traffic simulation SUMO SYNOPSIS
polyconvert [OPTION]* DESCRIPTION
SUMO polyconvert Version 0.15.0 Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net Importer of polygons and POIs for the road traffic simulation SUMO. Configuration Options: -c, --configuration-file FILE Loads the named config on startup --save-configuration FILE Saves current configuration into FILE --save-template FILE Saves a configuration template (empty) into FILE --save-schema FILE Saves the configuration schema into FILE --save-commented Adds comments to saved template, configuration, or schema Input Options: -n, --net-file FILE Loads SUMO-network FILE as reference to offset and projection --dlr-navteq-poly-files FILE Reads polygons from FILE assuming they're coded in DLR-Navteq (Elmar)-format --dlr-navteq-poi-files FILE Reads pois from FILE+ assuming they're coded in DLR-Navteq (Elmar)-format --visum-files FILE Reads polygons from FILE assuming it's a Visum-net --xml-files FILE Reads pois and shapes from FILE assuming they're coded in XML --osm-files FILE Reads pois from FILE+ assuming they're coded in OSM --osm.keep-full-type The type will be made of the key-value - pair. --osm.use-name The id will be set from the given 'name' attribute. --shapefile-prefixes FILE Reads shapes from shapefiles FILE+ --shapefile.guess-projection Guesses the shapefile's projection --shapefile.id-column FILE Defines in which column the id can be found --type-file FILE Reads types from FILE Output Options: -o, --output-file FILE Write generated polygons/pois to FILE Projection Options: --simple-projection Uses a simple method for projection --proj.scale INT Number of places to shift decimal point to right in geo-coordinates --proj.utm Determine the UTM zone (for a universal transversal mercator projection based on the WGS84 ellipsoid) --proj.dhdn Determine the DHDN zone (for a transversal mercator projection based on the bessel ellipsoid) --proj STR Uses STR as proj.4 definition for projection --proj.inverse Inverses projection Pruning Options: --prune.in-net Enables pruning on net boundaries --prune.in-net.offsets STR Uses STR as offset definition added to the net boundaries --prune.boundary STR Uses STR as pruning boundary --prune.keep-list STR Items in STR will be kept though out of boundary --prune.explicit STR Items with names in STR will be removed Processing Options: --offset.x FLOAT Adds FLOAT to net x-positions --offset.y FLOAT Adds FLOAT to net y-positions Building Defaults Options: --color STR Sets STR as default color --prefix STR Sets STR as default prefix --type STR Sets STR as default type --layer INT Sets INT as default layer --discard Sets default action to discard Report Options: -v, --verbose Switches to verbose output -p, --print-options Prints option values before processing -?, --help Prints this screen -V, --version Prints the current version -W, --no-warnings Disables output of warnings -l, --log FILE Writes all messages to FILE (implies verbose) --message-log FILE Writes all non-error messages to FILE (implies verbose) --error-log FILE Writes all warnings and errors to FILE EXAMPLES
polyconvert -c <CONFIGURATION> run with configuration options set in file REPORTING BUGS
Report bugs at <http://sourceforge.net/apps/trac/sumo/>. Get in contact via <sumo-user@lists.sourceforge.net>. Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net SUMO polyconvert Version 0.15.0 is part of SUMO. SUMO is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl.html SUMO polyconvert Version 0.15.0 May 2012 SUMO(1)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy