07-31-2008
Substituting variables from external files
Hi All,
I have the following problem:
1. I have a file containing a line:
a,b,d,${d},e,f
2. From within a script I grep the file for '^a,' to get the line
3. I obtain the fourth field as follows:
Field4="$( print -r $fileEntry | cut -d, -f4 )"
4. The script exports variables at the beginning including ${d}
How do I get ${Field4} to contain the substituted variable ${d} instead of the literal '${d}'
I hope this is clear, I am happy to explain anything if I am talking jibberish.
Thanks in advance.
Chris
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script run_batch.sh as below :-
PAR_VALIDATION=val_siconf
PAR_RUN_LEVEL=1
PAR_EXCLUSIVE_RUN_YN=Y
DATABASE_USER="/@"$TWO_TASK
sqlplus -s $DATABASE_USER |&
print -p -- 'set feed off pause off pages 0 head off veri off line 500'
print -p -- 'set term off time off... (1 Reply)
Discussion started by: suds19
1 Replies
2. Shell Programming and Scripting
Hello
Simple question about tcsh , i like to make external file that some tcsh script
will read from him var=="some value"
how can i make the include in tcsh files?
Thanks (0 Replies)
Discussion started by: umen
0 Replies
3. Shell Programming and Scripting
How do i use a config.txt to recursively pass a set of variables to a shell script
eg my config.txt looks like this :
path=c://dataset/set1
v1= a.bin
v2= b.bin
path=c://dataset/set2
v1= xy.bin
v2= abc.bin
..................
and so on .
and my testscript : (2 Replies)
Discussion started by: pradsh
2 Replies
4. Shell Programming and Scripting
I'm trying to get awk to do arithmetic functions with external variables and I'm getting an error that I cannot figure out how to fix.
Insight would be appreciated
money=$1
rate1=$(awk -F"\t " '/'$converting'/{print $3}' convert.table)
rate2=$(awk -F"\t"... (2 Replies)
Discussion started by: DKNUCKLES
2 Replies
5. Programming
Hi,
I have to run my JAVA programs in UNIX server. The java program uses some external jar files for compiling. I have set the classpath to the folder where all the jar files are present using EXPORT classpath command.
But when i compile, it shows errors.. saying that the classes relating... (8 Replies)
Discussion started by: satish2712
8 Replies
6. Shell Programming and Scripting
...
declare vINIFILE
vINIFILE=$1
...
echo "The name of the File is $vINIFILE" >>mail_tmp
echo "" >> mail_tmp.$$
...
grep RUNJOB=0 $vINIFILE >>tmp_filter
...
So the strange is in echo-statement I get the correct output for $vINIFILE wrtitten into the file mail_tmp. But the... (2 Replies)
Discussion started by: ABE2202
2 Replies
7. Shell Programming and Scripting
I am running Matlab in a unix enviroment and in my Matlab program I am calling an outside program (mav) to run with a unix command in Matlab:
unix('mav -u 5 -c 1 -s')
My goal is to edit the input files (three different files) for that external program and then run that external program... (0 Replies)
Discussion started by: heatona
0 Replies
8. Shell Programming and Scripting
Hello
I have a text file with the next pattern
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
I want to assign to external variables the grades using the awk method.
After i read the file line by line in order to get the grades i use this
... (2 Replies)
Discussion started by: Spleshmen
2 Replies
9. Shell Programming and Scripting
Hi I have an issue, I want to get variables from an external file. Variable file var1=test var2-test2 I want to get these vars from another shell script. Does any one know how? (5 Replies)
Discussion started by: digitalviking
5 Replies
10. Shell Programming and Scripting
I wrote a very simple script to understand how to call user-defined functions from within awk after reading this post.
function my_func_local {
echo "In func $1"
}
export -f my_func_local
echo $1 | awk -F"/" '{for (k=1;k<=NF;k++) {
if ($k == "a" ) {
system("my_local_func $k")
}
else{... (19 Replies)
Discussion started by: sreyan32
19 Replies
LEARN ABOUT LINUX
wxfiledialog
wxFileDialog(3erl) Erlang Module Definition wxFileDialog(3erl)
NAME
wxFileDialog - See external documentation: wxFileDialog.
DESCRIPTION
See external documentation: wxFileDialog .
This class is derived (and can use functions) from:
wxDialog
wxTopLevelWindow
wxWindow
wxEvtHandler
DATA TYPES
wxFileDialog() :
An object reference, The representation is internal and can be changed without notice. It can't be used for comparsion stored on disc
or distributed for use on other nodes.
EXPORTS
new(Parent::wxWindow() (see module wxWindow)) -> wxFileDialog()
Equivalent to new(Parent, []) .
new(Parent::wxWindow() (see module wxWindow), Options::[Option]) -> wxFileDialog()
Types Option = {message, string()} | {defaultDir, string()} | {defaultFile, string()} | {wildCard, string()} | {style, integer()} |
{pos, {X::integer(), Y::integer()}} | {sz, {W::integer(), H::integer()}}
See external documentation .
getDirectory(This::wxFileDialog()) -> string()
See external documentation .
getFilename(This::wxFileDialog()) -> string()
See external documentation .
getFilenames(This::wxFileDialog()) -> [[string()]]
See external documentation .
getFilterIndex(This::wxFileDialog()) -> integer()
See external documentation .
getMessage(This::wxFileDialog()) -> string()
See external documentation .
getPath(This::wxFileDialog()) -> string()
See external documentation .
getPaths(This::wxFileDialog()) -> [[string()]]
See external documentation .
getWildcard(This::wxFileDialog()) -> string()
See external documentation .
setDirectory(This::wxFileDialog(), Dir::string()) -> ok
See external documentation .
setFilename(This::wxFileDialog(), Name::string()) -> ok
See external documentation .
setFilterIndex(This::wxFileDialog(), FilterIndex::integer()) -> ok
See external documentation .
setMessage(This::wxFileDialog(), Message::string()) -> ok
See external documentation .
setPath(This::wxFileDialog(), Path::string()) -> ok
See external documentation .
setWildcard(This::wxFileDialog(), WildCard::string()) -> ok
See external documentation .
destroy(This::wxFileDialog()) -> ok
Destroys this object, do not use object again
AUTHORS
<>
wxErlang 0.98.9 wxFileDialog(3erl)