08-01-2002
Very impressive. I like.
Now lets see a list of examples for each command.
Just kidding.
Cool list though.
Tarballed
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I like to know the bare minimum development/ testing tools which can be used with Unix environment wherein the applications are written in different combination - C++ COBOL..
I like to know list of development, performance, testing tools that can be used in Unix .
Thanks in advance
ls1429 (1 Reply)
Discussion started by: ls1429
1 Replies
2. UNIX for Dummies Questions & Answers
okay, im having some trouble. Go ahead, call me a retard, but i keep getting stuck. Suppose i want to open a Picture of Jesus(for the sake of simplicity) using unix. I type:
open Desktop/Pictures/Jesus.jpg
It opens, and its all well and good. But, suppose i want to open a picture called Joe... (4 Replies)
Discussion started by: HipCracka
4 Replies
3. Shell Programming and Scripting
Hi there,
I am looking to create a single file called outputa.txt, which will show the contents of my directorya and its sub directories, and all file and directory permissions.
What command would be used for this?
Cheers
Kev (2 Replies)
Discussion started by: kev112
2 Replies
4. UNIX for Dummies Questions & Answers
What command would I use to list the first lines of all
text files within my Unix directory or within any directory
inside there? I was using "find" , "head" and "-exec" commands like this:
find ~/Unix -name "*.txt" -exec head {} \;
But its not perfectly working, please help me.... (2 Replies)
Discussion started by: carrera911
2 Replies
5. Solaris
Hi,
I am a novice in Unix installation.
Was experimenting with it.
During installation, i created 2 partitions ( what i am calling ).
One for the OS which was named SOLARIS & other was named PRI_DOS.
Now on completion of installation, where has my PRI_DOS portion gone.
How do i... (8 Replies)
Discussion started by: vibhor_agarwali
8 Replies
6. UNIX for Dummies Questions & Answers
I was wondering what command lines i could use to do the following.
1. mail a file to a user with a subject line "HELLO". Also, send a Blind carbon copy to a different user?
2. Display the number of files AND directories in a given directory?
3. Display the last 5 files in a given... (4 Replies)
Discussion started by: tragic54
4 Replies
7. Solaris
Hello,
I'm new to solaris and have an experience with linux. When we see network interface I can see qfe, hme, le0. What is that mean? Is it depend on the network card? (11 Replies)
Discussion started by: mokkan
11 Replies
8. Solaris
can any body tell me this followings in details
when do we use this & in which senario we most use this
1.GSD raising
2.MOSFET checks
3.Audit remedation
4.KBS fixes
thanks in advance (0 Replies)
Discussion started by: wkbn86
0 Replies
9. Shell Programming and Scripting
I am new to unix so this is probably a pretty basic question.
I am trying to write several commands on one line that creates a directory called bf in the current directory, then copy all files within that directory and any subdirectories, that do not start with the letter c to the new bf folder.... (5 Replies)
Discussion started by: scotty85
5 Replies
10. Shell Programming and Scripting
Hi,
I'm new to this and very much interested to learn unix.
Can any one explain me the symbols y we use this is scripting(~ and $).
It would be great if some one explain with the eg.
Thanks
Naveen A (2 Replies)
Discussion started by: Pranaveen
2 Replies
lset(n) Tcl Built-In Commands lset(n)
__________________________________________________________________________________________________________________________________________________
NAME
lset - Change an element in a list
SYNOPSIS
lset varName ?index...? newValue
_________________________________________________________________
DESCRIPTION
The lset command accepts a parameter, varName, which it interprets as the name of a variable containing a Tcl list. It also accepts zero
or more indices into the list. The indices may be presented either consecutively on the command line, or grouped in a Tcl list and pre-
sented as a single argument. Finally, it accepts a new value for an element of varName.
If no indices are presented, the command takes the form:
lset varName newValue
or
lset varName {} newValue
In this case, newValue replaces the old value of the variable varName.
When presented with a single index, the lset command treats the content of the varName variable as a Tcl list. It addresses the index'th
element in it (0 refers to the first element of the list). When interpreting the list, lset observes the same rules concerning braces and
quotes and backslashes as the Tcl command interpreter; however, variable substitution and command substitution do not occur. The command
constructs a new list in which the designated element is replaced with newValue. This new list is stored in the variable varName, and is
also the return value from the lset command.
If index is negative or greater than or equal to the number of elements in $varName, then an error occurs.
The interpretation of each simple index value is the same as for the command string index, supporting simple index arithmetic and indices |
relative to the end of the list.
If additional index arguments are supplied, then each argument is used in turn to address an element within a sublist designated by the
previous indexing operation, allowing the script to alter elements in sublists. The command,
lset a 1 2 newValue
or
lset a {1 2} newValue
replaces element 2 of sublist 1 with newValue.
The integer appearing in each index argument must be greater than or equal to zero. The integer appearing in each index argument must be
strictly less than the length of the corresponding list. In other words, the lset command cannot change the size of a list. If an index
is outside the permitted range, an error is reported.
EXAMPLES
In each of these examples, the initial value of x is:
set x [list [list a b c] [list d e f] [list g h i]]
-> {a b c} {d e f} {g h i}
The indicated return value also becomes the new value of x (except in the last case, which is an error which leaves the value of x
unchanged.)
lset x {j k l}
-> j k l
lset x {} {j k l}
-> j k l
lset x 0 j
-> j {d e f} {g h i}
lset x 2 j
-> {a b c} {d e f} j
lset x end j
-> {a b c} {d e f} j
lset x end-1 j
-> {a b c} j {g h i}
lset x 2 1 j
-> {a b c} {d e f} {g j i}
lset x {2 1} j
-> {a b c} {d e f} {g j i}
lset x {2 3} j
-> list index out of range
In the following examples, the initial value of x is:
set x [list [list [list a b] [list c d]]
[list [list e f] [list g h]]]
-> {{a b} {c d}} {{e f} {g h}}
The indicated return value also becomes the new value of x.
lset x 1 1 0 j
-> {{a b} {c d}} {{e f} {j h}}
lset x {1 1 0} j
-> {{a b} {c d}} {{e f} {j h}}
SEE ALSO
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lsort(n), lrange(n), lreplace(n), string(n) |
KEYWORDS
element, index, list, replace, set
Tcl 8.4 lset(n)