this is the code i am using. the called script will bounce the servers from the list.
the idea is to update this script in a webpage and those if-else can't be run and will only display the last server.
hence i want a variable that will hold the information about what all servers were parsed and increment it once the previous server was bounce and at last will print that the following servers (its content) were bounced.
Moderator's Comments:
Code tags for code, please.
Last edited by Corona688; 05-24-2012 at 02:20 PM..
Reason: na
hi,
i want to increment a Variable but it doesnt work.
here my codé
COUNT=1
COUNT= 'expr $COUNT + 1'
i've tried it in the prompt but it print me:
expr: syntaxerror
What does I make wrong? (4 Replies)
Hi,
I want to write a perl script, which will increment number stored in file. I want to do this without any file handles. I think we have to use some UNIX commands. I am not sure how to do this with file handles.
Thanks, (1 Reply)
Hi All,
I have a variable n that stores a number.
Eg. echo $n comes out to be 120.
I need to print 121 using echo command on n.
Please advice.
Thanks in advance !! (4 Replies)
Hello There,
I have been trying to increment the value of variable to 1, 2, 3 etc. but, it displays
1
1+1
1+1+1
.....
:wall:
Could anyone help out with this?
for i in *.*
do
s=`expr $s+1`
echo $s
j=$i$j
mv $i $j
done
Any help is appreciated? (24 Replies)
Hi there everyone!
This is my first post so be gentle.
I have a small bash script that is extracting 3 line every 3 lines. I got the AWK part but i cant do the loop part.
#!/bin/bash
export line=`awk 'END { print NR }' btnew`
echo $line
for i in {1..$line..3} #increment
do
echo... (2 Replies)
Hi All,
I am new to this forum and a novice at shell script. I am trying to write a script to determine each of the NIC configured on a linux system and its speed and Duplex. I came up with the following piece of code:
echo `ifconfig -a | grep eth > /home/a/nic.txt`
i=`awk -F, '{print... (4 Replies)
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
hey guys,
I need to incerement the date variable for instance
echo `date '+%F %H:%M:00'`
this produces
2014-08-02 20:05:00
-I will grant this to : $Datehour and need to assign 1 hr from now to $Datelasthour
-the script time will be used to talk to DB system information.
however... (4 Replies)
Hi,
I have parameter file wo_location.prm which has a date variable $last_upd_date= 02032016.
I need to write a unix shell script to find that variable and increment it by 1 day.
The path to the file is root/dir_lc/shared/param/wo_location.prm and the variable is $last_upd_date.
Any... (2 Replies)
Discussion started by: isenhiem
2 Replies
LEARN ABOUT SUSE
variable
variable(n) Tcl Built-In Commands variable(n)
__________________________________________________________________________________________________________________________________________________NAME
variable - create and initialize a namespace variable
SYNOPSIS
variable ?name value...? name ?value?
_________________________________________________________________DESCRIPTION
This command is normally used within a namespace eval command to create one or more variables within a namespace. Each variable name is
initialized with value. The value for the last variable is optional.
If a variable name does not exist, it is created. In this case, if value is specified, it is assigned to the newly created variable. If
no value is specified, the new variable is left undefined. If the variable already exists, it is set to value if value is specified or
left unchanged if no value is given. Normally, name is unqualified (does not include the names of any containing namespaces), and the
variable is created in the current namespace. If name includes any namespace qualifiers, the variable is created in the specified names-
pace. If the variable is not defined, it will be visible to the namespace which command, but not to the info exists command.
If the variable command is executed inside a Tcl procedure, it creates local variables linked to the corresponding namespace variables (and
therefore these variables are listed by info vars.) In this way the variable command resembles the global command, although the global
command only links to variables in the global namespace. If any values are given, they are used to modify the values of the associated
namespace variables. If a namespace variable does not exist, it is created and optionally initialized.
A name argument cannot reference an element within an array. Instead, name should reference the entire array, and the initialization value
should be left off. After the variable has been declared, elements within the array can be set using ordinary set or array commands.
EXAMPLES
Create a variable in a namespace:
namespace eval foo {
variable bar 12345
}
Create an array in a namespace:
namespace eval someNS {
variable someAry
array set someAry {
someName someValue
otherName otherValue
}
}
Access variables in namespaces from a procedure:
namespace eval foo {
proc spong {} {
# Variable in this namespace
variable bar
puts "bar is $bar"
# Variable in another namespace
variable ::someNS::someAry
parray someAry
}
}
SEE ALSO
global(n), namespace(n), upvar(n)
KEYWORDS
global, namespace, procedure, variable
Tcl 8.0 variable(n)