10 More Discussions You Might Find Interesting
1. Linux
A quick howto on how to set nautilus as your default filemanager.
Add this line to the file below. This is for user settings
inode/directory=nautilus.desktop
vi ~/.local/share/applications/mimeapps.list
This is for global settings.
ls /usr/share/applications | grep nautilus
Check... (1 Reply)
Discussion started by: cokedude
1 Replies
2. Shell Programming and Scripting
Can some one please help me with the syntax in shell script for the below :
if $var1 exists in ('val1','val2','val3')
I want to execute a set of commands if the value of var1 variable matches any one of the given string values. Please let me know if there are any other option to go by.
... (10 Replies)
Discussion started by: Pandee
10 Replies
3. Shell Programming and Scripting
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Discussion started by: u5j84
1 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
i really new in linux and just heard about shell scripting couple days ago..
i did exercises on linux in online tutorial but as a beginner, i'm facing problems in developing the script as there are errors that sometimes i dun have any idea on how to solve it.What i'm doing now is not... (3 Replies)
Discussion started by: tedy2808
3 Replies
5. Shell Programming and Scripting
Hi,
I have a scenario in which I have to substitute the variable to call the procedure "login" in Tcl.
for {set i 1} {$i<=2} {incr i} {
login "$spawn_id$i"
}
I have the variables $spawn_id1 and $spawn_id2 in the beginning of the script which I'm trying to pass to the procedure "login". So... (2 Replies)
Discussion started by: arun_maffy
2 Replies
6. Shell Programming and Scripting
Hi
I have e.g. VAR1=january and I need to change it into VAR1=January.
How to change value of VAR1 variable to always set first character uppercase and other lowercase ?
thx for help. (9 Replies)
Discussion started by: presul
9 Replies
7. Emergency UNIX and Linux Support
Hi All,
Can anyone please help me with the regular expression/code snippet to search for an IP address in a string with Tcl scripting.
Example string
"OSPF_NBRUP OSPF neighbor 16.138.181.15 (realm ospf-v2 e1-0/0/0:37.0 area 0.0.0.0) state changed from Full to Down due to KillNbr"
In the... (6 Replies)
Discussion started by: Mr. Zer0
6 Replies
8. Shell Programming and Scripting
Hi all,
I want to monitoring my interface every 6 hours where i want to run snoop command to capture all packet through the interface, so i want running snoop then snoop will run for 5 minutes after that snoop stop then will start again after 6 hours than run for 5 minutes again.
thereis any... (9 Replies)
Discussion started by: tindasz
9 Replies
9. UNIX for Dummies Questions & Answers
I have a comma delimited text file and need to appened ",000000" to the end of every line. For example:
Before:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll $" ,1103.45
After:
"D700000","2006" ,"5000","Open Year" ,"Conversion" ,"Wk64","Productive Payroll... (3 Replies)
Discussion started by: bggibson
3 Replies
10. Shell Programming and Scripting
Suppose pwd=/home/user/work/wip1
How to output the "pwd string" into 5 chunks?
/home/user/work/wip1
/home/user/work
/home/user
/home
/
:confused: (1 Reply)
Discussion started by: jehrome_rando
1 Replies
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)