lappend(n) Tcl Built-In Commands lappend(n)
__________________________________________________________________________________________________________________________________________________NAME
lappend - Append list elements onto a variable
SYNOPSIS
lappend varName ?value value value ...?
_________________________________________________________________DESCRIPTION
This command treats the variable given by varName as a list and appends each of the value arguments to that list as a separate element,
with spaces between elements. If varName does not exist, it is created as a list with elements given by the value arguments. Lappend is
similar to append except that the values are appended as list elements rather than raw text. This command provides a relatively efficient
way to build up large lists. For example, "lappend a $b" is much more efficient than "set a [concat $a [list $b]]" when $a is long.
EXAMPLE
Using lappend to build up a list of numbers.
% set var 1
1
% lappend var 2
1 2
% lappend var 3 4 5
1 2 3 4 5
SEE ALSO
list(n), lindex(n), linsert(n), llength(n), lset(n), lsort(n), lrange(n)
KEYWORDS
append, element, list, variable
Tcl lappend(n)
Check Out this Related Man Page
lappend(3tcl) Tcl Built-In Commands lappend(3tcl)__________________________________________________________________________________________________________________________________________________NAME
lappend - Append list elements onto a variable
SYNOPSIS
lappend varName ?value value value ...?
_________________________________________________________________DESCRIPTION
This command treats the variable given by varName as a list and appends each of the value arguments to that list as a separate element,
with spaces between elements. If varName does not exist, it is created as a list with elements given by the value arguments. Lappend is
similar to append except that the values are appended as list elements rather than raw text. This command provides a relatively efficient
way to build up large lists. For example, "lappend a $b" is much more efficient than "set a [concat $a [list $b]]" when $a is long.
EXAMPLE
Using lappend to build up a list of numbers.
% set var 1
1
% lappend var 2
1 2
% lappend var 3 4 5
1 2 3 4 5
SEE ALSO list(3tcl), lindex(3tcl), linsert(3tcl), llength(3tcl), lset(3tcl), lsort(3tcl), lrange(3tcl)KEYWORDS
append, element, list, variable
Tcllappend(3tcl)
Hello,
I am new to this site, so sorry ahead of time if this is not the right place for this question.......anywhooooo
I am having troubles with forking new processes in wish. Take the following code example:
****************************
package require Tclx
puts "TCL VER: "
proc... (3 Replies)
I'm trying to write a script that will do the following:
Open a text file for reading/writing.
Read each line.
When I find a specfic value in a line, append something to the end of that line.
I loop through and read all the lines in myfile.txt looking for dev123_data_log and find a... (5 Replies)
i have a file as below and i need to load it into oracle. The problem is, some of the rows are in 2 lines.
123456_PosWlist ----- ----- IN 0/0
123456_PosWListRpt ----- ----- IN 0/0
123456_PosWListCSV
----- -----... (7 Replies)
I am writing a script to check whether the root password is set to a special string on some solaris servers.
Normally, the manually ssh login session is as below:
$ ssh root@host1
Password:
Last login: Wed Sep 16 13:53:28 2009 from 10.1.102.13
Sun Microsystems Inc. SunOS 5.10 ... (4 Replies)
Hi ,
I have a TCL script which i am supposed to run as a cron job..
The script works fine from command line , but when run as a cron job , its unable to find a package,,
my crontab is as follows.
---------------------------
#!/usr/bin/ksh
* * * * * PATH=/cm8/auto/Automation/Library/TclLib
... (7 Replies)
hi all, guys i have a problem in this code...
any help ?
#!/usr/bin/expect
if { $argc != 3 } {
puts "Usage:"
puts "$argv0 username oldpwd newpwd"
exit
}
#set machine
set username
set oldpwd
set newpwd
set completed_list " " (2 Replies)
Hi All,
I used before a simple routine code in tcl to send mail.
package require smtp
package require mime
package require Tcl
proc send_simple_message {recipient email_server subject body} {
set token
mime::setheader $token Subject $subject
smtp::sendmessage $token \
... (0 Replies)
I would like to create an array using tcl script which takes in name, id, and marks of many people in 3 subjects.
I would like calculate the total marks of each person and rank them according to their marks.
Taking name as my key for access i want to do sort and rank the person based on highest... (3 Replies)
Dear Users
I'm struck by while the following tcl script.
foreach l {
set w($l) {}
set fsum 0
foreach ftemp $f($l) {
set fsum
lappend w($l) $fsum
}
}
It shows me error as "missing operand at _@_
in expression "0.10308400000000001 + _@_* 0.4 * 1"
... (0 Replies)
Hey all. I'm writing a script to automatically login to a router, change directories to where crashfiles are located, then listing all files in that directory. This is where I'm at so far and wish to have some user interaction to choose the files.
What I am trying to do is list the files and get... (1 Reply)
Hi,
Can a function written in tcl in some other file be called in unix scripts ?
Like this ?
This is my code now---
shell.sh:
#!/bin/bash
tclsh snmpv2-conf-sam.tcl $SERVER $NODESYSIP $SPASSWD
but i need this in a different way like , without having a .tcl file i want the... (2 Replies)