03-18-2013
Multiple arguments to read
I am developing a script where 3 other scripts are included.
This is a graph related script.
COMPLETE IDEA:
-There are 3 different graph scripts. I would like to create a master graph with all 3 in one.
-User chooses the type of graph
-User is asked to enter the required auguments ( File name, Offset, latency and sampling are common to all 3). But 2 graphs should have a choice of mode for latency calculation.
PROBLEM:
1 How do i read the required arguments.
2 once i read them, how would i pass it to the corresponding graph script?
Please help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am writing script in c shell and using this script to read the command line arguments, but it is not working. Pl. someone let me know what is the problem.
#!/bin/csh -f
if ($#argv <> 2) then
echo "you must give exactly two parameters"
else
set name1 = $argv
... (1 Reply)
Discussion started by: skumar11
1 Replies
2. Programming
I have to write a C program using sys call (read, no fread) to read from shell all the parameters, without know how many are them.
I tryed in some ways, but I have no success.
Any Idea?
Can I use read to read from stdin? (1 Reply)
Discussion started by: DNAx86
1 Replies
3. Shell Programming and Scripting
In the make file
update updateq:
-------------------
----------
i want the makefile to display some messages when user gives "make update", but totally quite wehn user enters "make updateq". Can u tell me how to read these argument in makefile.
$1 doesnt work:( (3 Replies)
Discussion started by: vikashtulsiyan
3 Replies
4. Shell Programming and Scripting
Hi, Guys
I am new to shell programming and just get stuck with one simple question. please kindly help.
According to the tutorial here, we can do something like
for NODE in "ABC 10" "EFG 20"
do
set -- $NODE
echo "letter is $1, number is $2"
done
And the result will... (3 Replies)
Discussion started by: yuanli
3 Replies
5. Programming
Hello everybody,
I'm coding a program in C and i'm getting troubles with this.
I need to read a config file and store the arguments into individual variables, let's say the config file looks like the following:
#This is the configuration file...
192.168.0.1 A1:B1:C1:D1:E1:F1
192.168.0.2... (2 Replies)
Discussion started by: semash!
2 Replies
6. Shell Programming and Scripting
I have trouble getting this logic to work
#!/bin/bash
function assign_var(){
while
do
read -p "$2 :" $3
done
}
assign_var '$IPADDRESS' ipaddress IPADDRESS
Basicly, i want to make sure that entry is made (i can add more sophisticated checks later), but the idea is to recycle... (11 Replies)
Discussion started by: serverchief
11 Replies
7. Programming
I have the following piece of code. Currently the command line arguments are passed as shown below using the "= "sign. I capture the name of the argument, for example vmod and it's corresponding user parameter which is jcdint-z30.cmd.
./raytrac vmod=jcdint-z30.cmd srFile=jcdint.sr
Now I want... (12 Replies)
Discussion started by: kristinu
12 Replies
8. Shell Programming and Scripting
I am new to schell scripting . My objective is to write a ksh shell script that performs following tasks: -
1. Script reads all command line arguments (arguments are file names) and checks if it contains charachters "abc" in it.
2. If it contains "abc" it will execute a binary file xyz <command... (3 Replies)
Discussion started by: acmilan
3 Replies
9. Shell Programming and Scripting
Hi,
I need to get input arguments, as well as validate them. This is how I'm reading them:
#!/bin/bash
args="$@" # save arguments to variable
## Read input arguments, if so
while ; do
case $1 in
-v | --verbose ) verbose=true;;
-z | --gzip ) compression="gz";;
... (3 Replies)
Discussion started by: AlbertGM
3 Replies
10. UNIX for Advanced & Expert Users
Heays
So i have that script to which i'd like to pipe (rather than just regular arguments) some data from another virtual output command.
Simplified:
echo * | script.sh
When i know how many args i expect, i can handle this simple by:
&& \
read ONE TWO && \
set ONE TWO
echo "$1 : $2... (7 Replies)
Discussion started by: sea
7 Replies
LEARN ABOUT DEBIAN
hobbit-hostgraphs.cgi
HOBBIT-HOSTGRAPHS.CGI(1) General Commands Manual HOBBIT-HOSTGRAPHS.CGI(1)
NAME
hobbit-hostgraphs.cgi - CGI program to show multiple graphs
SYNOPSIS
hobbit-hostgraph.cgi
DESCRIPTION
hobbit-hostgraph.cgi is invoked as a CGI script via the hobbit-hostgraph.sh CGI wrapper.
If no parameters are provided when invoked, it will present a form where the user can select a time period, one or more hosts, and a set of
graphs.
The parameters selected by the user are passed to a second invocation of hobbit-hostgraph.cgi, and result in a webpage showing a list of
graph images based on the trend data stored about the hosts.
If multiple graph-types are selected, hobbit-hostgraph.cgi will display a list of graphs, with one graph per type.
If multiple hosts are selected, hobbit-hostgraph.cgi will attempt to display a multi-host graph for each type where the graphs for all
hosts are overlayed in a single image, allowing for easy comparison of the hosts.
The hostlist uses the PAGEPATH cookie provided by Xymon webpages to select the list of hosts to present. Only the hosts visible on the page
where hobbit-hostgraph.cgi is invoked from will be visible.
The resulting graph page can be bookmarked, but the bookmark also fixates the time period shown.
OPTIONS
--env=FILENAME
Loads the environment defined in FILENAME before executing the CGI script.
BUGS
This utility is experimental. It may change in a future release of Xymon.
It is possible for the user to select graphs which do not exist. This results in broken image links.
The set of graph-types is fixed in the server/web/hostgraphs_form template and does not adjust to which graphs are available.
If the tool is invoked directly, all hosts defined in Xymon will be listed.
SEE ALSO
bb-hosts(5), hobbitserver.cfg(5)
Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-HOSTGRAPHS.CGI(1)