Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

list(1t) [opensolaris man page]

list(1T)						       Tcl Built-In Commands							  list(1T)


list - Create a list SYNOPSIS
list ?arg arg ...? _________________________________________________________________ DESCRIPTION
This command returns a list comprised of all the args, or an empty string if no args are specified. Braces and backslashes get added as necessary, so that the lindex command may be used on the result to re-extract the original arguments, and also so that eval may be used to execute the resulting list, with arg1 comprising the command's name and the other args comprising its arguments. List produces slightly different results than concat: concat removes one level of grouping before forming the list, while list works directly from the original arguments. EXAMPLE
The command list a b "c d e " " f {g h}" will return a b {c d e } { f {g h}} while concat with the same arguments will return a b c d e f {g h} SEE ALSO
lappend(1T), lindex(1T), linsert(1T), llength(1T), lrange(1T), lreplace(1T), lsearch(1T), lset(1T), lsort(1T) | KEYWORDS
element, list ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on Tcl list(1T)

Check Out this Related Man Page

linsert(1T)						       Tcl Built-In Commands						       linsert(1T)


linsert - Insert elements into a list SYNOPSIS
linsert list index element ?element element ...? _________________________________________________________________ DESCRIPTION
This command produces a new list from list by inserting all of the element arguments just before the index'th element of list. Each ele- ment argument will become a separate element of the new list. If index is less than or equal to zero, then the new elements are inserted at the beginning of the list. If index has the value end, or if it is greater than or equal to the number of elements in the list, then the new elements are appended to the list. end-integer refers to the last element in the list minus the specified integer offset. EXAMPLE
Putting some values into a list, first indexing from the start and then indexing from the end, and then chaining them together: set oldList {the fox jumps over the dog} set midList [linsert $oldList 1 quick] set newList [linsert $midList end-1 lazy] # The old lists still exist though... set newerList [linsert [linsert $oldList end-1 quick] 1 lazy] SEE ALSO
list(1T), lappend(1T), lindex(1T), llength(1T), lsearch(1T), lset(1T), lsort(1T), lrange(1T), lreplace(1T) | KEYWORDS
element, insert, list ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on Tcl 8.2 linsert(1T)
Man Page

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assigning output of command to a variable

Hi, I'm trying to assign the output of a command to a variable and then concat it with another string, however, it keeps overwriting the original string instead of adding on to the end of the string. Contents of test.txt --> This is a test var1="`head -n 1 test.txt`" echo $var1 (This is a... (5 Replies)
Discussion started by: oma04
5 Replies

2. Shell Programming and Scripting

concat string

hey, I want to concat whole bunch of strings together but somehow they don't turn out the way I want them to a="HELLO " b="WORLD " c=$a$b I was expecting c to be "HELLO WORLD " but it... (1 Reply)
Discussion started by: mpang_
1 Replies

3. UNIX for Dummies Questions & Answers

String concat that keeps quotes

Hi All, I hope you can help. i am concatenating String variables using the following method. command="$command$x" i have created a script which takes a set of args passed to the script using the $* #example script args=$* count=0 for x in $args do count=`expr $count + 1` ... (8 Replies)
Discussion started by: duke
8 Replies

4. Shell Programming and Scripting

rollup and concat fields in a group

Hello, I have a file with two fields in the following format.. NewYork|Rob Boston|Mellisa NewYork|Kevin Boston|John Chicago|Mike Boston|Tom My output should be: NewYork|Rob,Kevin Boston|Mellisa,John,Tom Chicago|Mike Basically I need to rollup on column A and stringconcat column... (5 Replies)
Discussion started by: bperl
5 Replies

5. Shell Programming and Scripting

Filename (concat) head -1 > newfilelist

Gurus. Would appreciate your help very much. I would like to list all the files in directory, and concat the header record in each file with the filename, and output that list to a filelist. ie. filename|header{filename} Thanks in advance (6 Replies)
Discussion started by: sats2059
6 Replies