05-21-2013
Let me see if I have this straight. You define the variables STATE, END, CYAN, and SERSTAT in a shell script. Then you define a function named ServerStop that uses the values of the above variables that were defined before the function is defined (and those values are never updated). The script never invokes the function it has defined.
What output did you expect to be produced by defining a function that you never call?
If you want the value of STATE to change, you need to redefine the value of the variable.
This User Gave Thanks to Don Cragun For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Bit of a newbie :D with regard to unix scripting and need some advice. Hopefully someone can help with the following:
I have a predefined set of variables as follows:
AAA_IP_ADD=1.1.1.1
BBB_IP_ADD=2.2.2.2
I have a funnction call which retrieves a value into $SUPPLIER which would be... (3 Replies)
Discussion started by: ronnie_uk
3 Replies
2. Shell Programming and Scripting
Hi All,
I have the below scenario:
A file test.cfg with three fields>>
DATA1 DATA2 DATA3
In the script I need to assign each of the fields to variables. The number of fields will not be constant (this case we have three). Im trying to do something like this:
NUM=1
OUT_DAT_NO=3
... (4 Replies)
Discussion started by: deepakgang
4 Replies
3. Shell Programming and Scripting
I found one post in another site with a solution for my problem
the below solution should explain what I want.
#!/bin/sh
first="one"
second="two"
third="three"
myvar="first"
echo ${!myvar}
But this gives error 'bad substitution'
System info
SunOS sundev2 5.9... (3 Replies)
Discussion started by: johnbach
3 Replies
4. Shell Programming and Scripting
I need some variable help
TEMP1=Jane
TEMP2=Sue
X=1
eval USER=TEMP${X}
echo $USER
This gives output USER1
I would like to get Jane
I have tried
eval USER='TEMP${X}'
eval USER="TEMP${X}"
eval USER=`TEMP${X}` (3 Replies)
Discussion started by: Jotne
3 Replies
5. Shell Programming and Scripting
QUERY IN BRIEF
Listing the query in short
#! /bin/csh -f
#say i have invoked the script with two arguments : a1 and 2
set arg = $1 # that means arg = a1
echo "$arg" #it prints a1
#now what i want is:
echo "$a1"
#it will give error message :a1 undefined.
#however what i need is that the... (2 Replies)
Discussion started by: animesharma
2 Replies
6. Shell Programming and Scripting
Hi guys.
i have a requirment as below.
I have a scripts which perform for loop
for i in /backup/logs -- it will give all the logs file
SC_RIO_RWVM_20120413064217303.LOG
SC_RIO_RWXM_20120413064225493.LOG
SC_RIO_RXXM_20120413064233273.LOG
...
do
open script.sh ---- in this file... (3 Replies)
Discussion started by: guddu_12
3 Replies
7. Shell Programming and Scripting
Hello,
I have a problem with a bash script, I've been doing recherches but i can't make it work. It is my first time with a dynamic variable and i don't understand how to write it.
#!/bin/bash
USER=BARSPIN
HOTKEYS_PATH="/home/$USER/Documents/bash/tibia/HOTKEYS"
CFG1="A"
CFG2="B"... (5 Replies)
Discussion started by: barspin
5 Replies
8. Shell Programming and Scripting
I have a small program which needs to pass variable dynamically to form the name of a second variable whose value wil be passed on to a third variable.
***************** Program Start ******************
LOC1=/loc1
PAT1IN=/loc2
PAT2IN=/loc3
if ; then
for fpattern in `cat... (5 Replies)
Discussion started by: Cyril Jos
5 Replies
9. UNIX for Dummies Questions & Answers
I am trying to create some variables based on the input by the user, say if user entered 3 then 3 variables and if 5 then 5 variables.
I am using a for loop
for (( i=1; i <= $num; i++ ))
do
x="num"
x+=$i
done
When i am using echo $x it will show num1 but now how to create variables... (3 Replies)
Discussion started by: Raj999
3 Replies
10. Shell Programming and Scripting
Hello,
I'm trying to build a small script to store a command into a dynamic variable, and I have trouble assigning the variable.
#!/bin/bash
declare -a var1array=("value1" "value2" "value3")
var1arraylength=${#var1array}
for (( i=1; i<${var1arraylength}+1; i++ ));
do
mkdir... (7 Replies)
Discussion started by: alex2005
7 Replies
LEARN ABOUT NETBSD
transferfunct
TransferFunct(3U) InterViews Reference Manual TransferFunct(3U)
NAME
TransferFunct - transfer function base class
SYNOPSIS
#include <Unidraw/transfn.h>
DESCRIPTION
A transfer function defines relationships between state variables. A component uses a transfer function to enforce dependencies between
its state variables during dataflow. State variables whose values change as a result of data flowing into the component can thus affect the
component's dependent state variables as defined by its transfer function. A transfer function can define dependencies between any number
of state variables, but a component can define only one transfer function.
PUBLIC OPERATIONS
virtual void Evaluate(Path* = nil)
Enforce the transfer function's dependencies between its state variables, optionally depending on the information in a path. This
operation does nothing by default.
virtual TransferFunct* Copy()
Return a copy of the transfer function. Subclasses redefine this operation to return an instance of their type.
virtual void Read(istream&)
virtual void Write(ostream&)
Read and write the transfer function's contents to a stream to support catalog operations. Read and write typically call first the
corresponding operations defined by their parent class, and then they read or write their class-specific state.
virtual ClassId GetClassId()
virtual boolean IsA(ClassId)
GetClassId returns the unique class identifier for the TransferFunct subclass, while IsA returns whether the instance is of a class
or subclass corresponding to the given identifier. IsA typically checks the given identifier against the instance's own (as defined
by its GetClassId operation) and, failing that, calls its parent classes' IsA operation. All subclasses must redefine GetClassId
and IsA to ensure that their identifiers are unique and that instances are written and read properly.
PROTECTED OPERATIONS
TransferFunct()
The constructor is protected to prevent instantiation.
virtual Connector* GetBinding(StateVar*)
Return the connector to which a state variable is bound.
SEE ALSO
Catalog(3U), Component(3U), Connector(3U), Creator(3U), Path(3U), StateVar(3U) classes(3U), istream(3C++), ostream(3C++)
Unidraw 6 August 1990 TransferFunct(3U)