09-27-2013
Why are you trying to do this? Dynamic variable names are generally a terrible idea, and the usual things people want them for are often easily solved by other methods.
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi ,
like to ask if we use ksh script to take in parameter into $1
and how do i concatenate the $1 value with some words into a variable?? Below is what i have written and i think is wrong ,how do i write it?
datafile="Report" || $1 || ".xls" (Should become Report2000.xls)
echo... (3 Replies)
Discussion started by: blueberry80
3 Replies
2. Shell Programming and Scripting
I need a way to build variable in this manner:
variable_$i
Inside a for loop i need to create it.
where i goes from 1 to 30..
and then i need to print them on screen with echo $variable_$i
which is the best way to do this? (6 Replies)
Discussion started by: sreedivia
6 Replies
3. Shell Programming and Scripting
Hi,
I'm new to shell programming.
I have two variables a and b
a=val1
b=val2
could anyone kindly post the shell script to concatenate the values of variable a and b with an underscore(_) in between?
The final output should be val1_val2. (8 Replies)
Discussion started by: badrimohanty
8 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
How to concatenate a string to a variable in a script
I'm having a file which is consisting of data and i need to extract the first line of the file and append it to a string.
/tmp/samp.list containg 60000
I like to concatenate it with a string (SS_)
grep -w SS_$(head -1... (1 Reply)
Discussion started by: nkamalkishore
1 Replies
5. Shell Programming and Scripting
Hello,
I have a tricky problem:
I have a $file with a variable number of occurrences of "ORA-" (in this case two)
..........
EXP-00008: ORACLE error 3113 encountered
ORA-03113: end-of-file on communication channel
EXP-00056: ORACLE error 1403 encountered
ORA-01403: no data found... (9 Replies)
Discussion started by: Laurentiu
9 Replies
6. Shell Programming and Scripting
Hello,
It might be stupid question But I will ask it any way:)
var1="1 2 3 4"
var2="5 6 7 8"
var3=$var1\ $var2
var4="$var1\n$var2"
echo "$var1"
echo "$var2"
echo "$var3"
echo "$var4"
The result of executing this code is as follow
1 2 3 4
5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4\n5 6... (12 Replies)
Discussion started by: fdc2suxs
12 Replies
7. Shell Programming and Scripting
I need to know how to concatenate variables in Debian. I am making a interactive script where it ask the user for info to add a user I pull the first letter from the first middle and last name into individual variables now i want to put them all in one variable so i can put it into useradd command ... (4 Replies)
Discussion started by: HackerSeabass
4 Replies
8. Shell Programming and Scripting
Cannot combine these two strings into one line, either as a 3rd variable or echo or printing ? Frustrating.
for i in `cat /scripts/pathList.dat`
do
OldRepo= grep Oldhostname ${i}/.svn/entries | tail -1
NewRepo= grep Oldhostname ${i}/.svn/entries | tail -1 | sed '/Oldhostname/... (41 Replies)
Discussion started by: pcpinkerton
41 Replies
9. Shell Programming and Scripting
I have the path name in a Variable
Ex:
$XML_PATH_FLAG = /ebs/appl/u00/universe01/inbound/universeorders
Now I have to pick up ALL XML files in this directory . In other words
I have to pick up ALL the files
/ebs/appl/u00/universe01/inbound/universeorders/F1.xml... (2 Replies)
Discussion started by: Pete.kriya
2 Replies
10. Shell Programming and Scripting
Hi
My goal is to fill an HTML form and submit.
What I have managed to do:
1. curl command to fill up the form and submit
2. a file which has the input
curl command:
curl -v -b cookie.txt -d __CSRFToken__=dc23d5da47953b3b390ec68d972af10380908b14 -d do=create -d a=open -d... (10 Replies)
Discussion started by: zorrox
10 Replies
LEARN ABOUT DEBIAN
config::grammar::dynamic
Config::Grammar::Dynamic(3pm) User Contributed Perl Documentation Config::Grammar::Dynamic(3pm)
NAME
Config::Grammar::Dynamic - A grammar-based, user-friendly config parser
DESCRIPTION
Config::Grammar::Dynamic is like Config::Grammar but with some additional features useful for building configuration grammars that are
dynamic, i.e. where the syntax changes according to configuration entries in the same file.
The following keys can be additionally specified in the grammar when using this module:
Special Section Keys
_dyn A subroutine reference (function pointer) that will be called when a new section of this syntax is encountered. The subroutine
will get three arguments: the syntax of the section name (string or regexp), the actual name encountered (this will be the same
as the first argument for non-regexp sections) and a reference to the grammar tree of the section. This subroutine can then
modify the grammar tree dynamically.
_dyndoc A hash reference that lists interesting names for the section that should be documented. The keys of the hash are the names and
the values in the hash are strings that can contain an explanation for the name. The _dyn() subroutine is then called for each
of these names and the differences of the resulting grammar and the original one are documented. This module can currently
document differences in the _vars list, listing new variables and removed ones, and differences in the _sections list, listing
the new and removed sections.
_recursive Array containing the list of those sub-sections that are recursive, ie. that can contain a new sub-section with the same
syntax as themselves.
The same effect can be accomplished with circular references in the grammar tree or a suitable _dyn section subroutine (see
below}, so this facility is included just for convenience.
Special Variable Keys
_dyn A subroutine reference (function pointer) that will be called when the variable is assigned some value in the config file. The
subroutine will get three arguments: the name of the variable, the value assigned and a reference to the grammar tree of this
section. This subroutine can then modify the grammar tree dynamically.
Note that no _dyn() call is made for default and inherited values of the variable.
_dyndoc A hash reference that lists interesting values for the variable that should be documented. The keys of the hash are the values
and the values in the hash are strings that can contain an explanation for the value. The _dyn() subroutine is then called for
each of these values and the differences of the resulting grammar and the original one are documented. This module can
currently document differences in the _vars list, listing new variables and removed ones, and differences in the _sections
list, listing the new and removed sections.
COPYRIGHT
Copyright (c) 2000-2005 by ETH Zurich. All rights reserved. Copyright (c) 2007 by David Schweikert. All rights reserved.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHORS
David Schweikert, Tobias Oetiker, Niko Tyni
perl v5.10.0 2007-09-25 Config::Grammar::Dynamic(3pm)