In your original example the variable i was assigned the whole record (e.g. val1:env1:opt1). In the code that zaxxon suggested, the components val1 env1 opt1 were broken out and assigned to variables A, B and C. There would be no need to reference i, as there wasn't anything assigned to i anyway. You should be able to use A, B, and C as is.
From your original post, you also do a lot of extra work to only read a subset of lines from the input file. That isn't handled by zaxxon's example. Moving along the same lines as was offered, the following code will generate just the lines between START and STOP (inclusive) and assign them to the variables f1, f2, and f3 (A, B, C).
I'm trying to pass a filename, or all the files in the current directory to the ls command with a script. Unsuccessful so far, here are a few of my attempts:
#!/bin/ksh
read fname
#if (( $# > 0 )); then
$fname | ls -l
#fi
this produces a long listing of all the files in my current... (4 Replies)
Hi, so Im a bit new to shell scripting and want to do the following but not sure how. Basically I have a file named "output" which contains misc text but inside the file I want to set up variables like $1 or some symbol. Anyways, in another file called "list" I have a list of items that I want to... (11 Replies)
Hi,
I have a script which adds the user credentials to an ldap server. Im passing the variables as below..
/path/my_script $uname $pwd $environ ${deposit}
If i enter some special characters like ';' in $pwd, script returns an error which is set to display if the user enters... (5 Replies)
Hi
I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like
./abc def /file <directory location>
In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after... (4 Replies)
I have a shell script which is invoked by passing an argument. The outer shell script calls another subshell and I want the argument passed down to flow down to the subshell.
E.g
Invoking a shell ======>> abc_refresh.ksh NM
Below is the content of abc_refresh.ksh
Value1=$1... (7 Replies)
I need to pass arguments to a shell script.My batch is calling some java program.
#################
x=$1
y=$2
java -classpath program
###################
if first parameter and second parameter is null then
java -classpath program
if first parameter is not null and second parameter is... (3 Replies)
I have noticed this thing using csh when passing arguments
Suppose I call a csh script using
../Scripts/plot-model.csh -vmod="npt02-z30.vmod" -R="0/80/0/30" -c="0/4.5" -aspr="1:10"
Somehow the " get removed when doing
$argv
ending up with
-vmod=npt02-z30.vmod... (0 Replies)
hi All,
i am trying to pass arguments that contain space , value will be stored in variables to be used further in script , i went thru previous posting , still its not clear to how to implement for my case.
passing 3 args
test.sh it is 'fun to work in unix'
inside shell
... (3 Replies)
I have a script test.sh which reads various inputs from a user.
#!/bin/ksh
read x
read y
read z
echo x: $x y: $y z: $z
# read few more things again
read a
read b
echo a: $a b: $b
When i run this script as
test.sh << EOF
1
2
EOF (3 Replies)
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies
LEARN ABOUT DEBIAN
tablix2_benchmark
TABLIX(1) Tablix User's Manual TABLIX(1)NAME tablix2_benchmark - Tablix benchmark utilitySYNOPSIS tablix2_benchmark benchmark [ options ] " Tablix options " file
DESCRIPTION Tablix is a powerful free software kernel for solving general timetabling problems. It uses a coarse-grained parallel genetic algorithm in combi-
nation with other techniques to construct sensible timetables from XML formatted problem descriptions. Tablix can run on a single host as well as
on a heterogeneous parallel virtual machine using PVM3.tablix2_benchmark is used to test the effect of different Tablix command line options on the final result. In most tests Tablix is started multi-ple times with the same input file to provide more reliable results. Each time Tablix is started, three variables are measured: the fitness value
of the resulting timetable, serial number of the last generation and elapsed time (in seconds). When a test is finished, the average for each
variable, as well as the maximum and minimum values are printed on standard output. The exact format depends on each test.The actual timetables that are generated during these tests are stored under a temporary file names in the current directory and are deleted aftertablix2_benchmark exits.In some cases tests can take several days to complete. Because the genetic algorithm can in some cases go into an endless loop, it is always
advisable to limit Tablix execution time with the -t option. This way at least the maximum execution time for a test can be calculated.
tablix2_benchmark will detect when the time limit set by the -t option was reached. This information will be included in the final statistics.OPTIONS The following tests are supported:
tablix2_benchmark --single "OPTIONS" file
Execute a single Tablix run using and print the results. OPTIONS parameter is mandatory and contains options that will be passed to the tablix2
process.
tablix2_benchmark --multiple N "OPTIONS" FILE
Execute N Tablix runs and print the statistics. OPTIONS parameter is mandatory and contains options that will be passed to the tablix2 process.
tablix2_benchmark --graph START STEP STOP "OPTIONS" FILE
Execute multiple Tablix runs. The character " N " in OPTIONS is substituted for an integer that is changed from START to STOP by STEP . Output is
gnuplot friendly.
tablix2_benchmark --multi-graph M START STEP STOP "OPTIONS" FILE
Execute multiple Tablix runs. The character " N " in OPTIONS is substituted for an integer that is changed from START to STOP by STEP . M Tablix
runs are executed for each value of N . Output is gnuplot friendly (use errorbars).
EXAMPLES The following test can be for example used to see the minimum grade, that can be reached with this configuration file:
tablix2_benchmark --multiple 5 "-t 90 -n 5" sample.xml
Tablix will be started five times. Each time with five computing nodes and with 90 minute time limit.tablix2_benchmark can also provide useful data for developers. Following test can be used to check the effect of the number of computing nodes on
the total time required to obtain the result:
tablix2_benchmark --multi-graph 5 1 1 10 "-t 90 -n N" sample.xml > stats.txt
Tablix will be started 50 times. 5 times for each value of N (which in this case means the number of nodes). Ten values of N will be probed: from
1 to 10 with steps of 1. The output will be redirected to stats.txt . A graph of average computing time versus number of nodes can then be pro-duced in gnuplot with the following command:
plot "test.txt" using ($1):($8):($9):($10) with yerrorbars
BUGS tablix2_benchmark utility depends on a number of common UNIX programs (mktemp, grep, sed, awk, ...) that may not be available on all systems. Thescript is not currently capable of properly detecting if any required programs are missing.AUTHOR Tomaz Solc (tomaz.solc@tablix.org)
SEE ALSO tablix2(1), Tablix User's Manual, Tablix modules HOWTO, Tablix on Morphix HOWTO
Tomaz Solc 2005-09-03 TABLIX(1)