10 More Discussions You Might Find Interesting
1. Red Hat
Hi
I need to install expect in redhat.
through net I came to know that I must install tcl too in order to make expect work.
I have downloaded both packages but not able to install
# ls -lrt
total 3720
18:33 tcl8.4.20-src.tar.gz
18:33 expect5.45.3.tar.gz
18:40 expect5.45.3... (7 Replies)
Discussion started by: scriptor
7 Replies
2. Shell Programming and Scripting
Hi,
I have written a unix expect utility "ssh-login.exp" which connects (ssh) to remote host and execute some shell script. I am calling this "ssh-login.exp" utility from another shell script.
"ssh-login.exp" takes username, password, host and shell script path to execute on remote host. All... (1 Reply)
Discussion started by: Mahesh Desai
1 Replies
3. Shell Programming and Scripting
Hi all,
while surfing across the net, I came across these lines,
In that I did not get how "# the next line restarts using tclsh \
" . . ?
I found this on below link,
http://tmml.sourceforge.net/doc/tcl/tclsh.html
Please refer original page once.
Thanks in advance . .
... (1 Reply)
Discussion started by: manands07
1 Replies
4. Shell Programming and Scripting
how can i make a list with the n last files and their details in tcl?..
thanks. (0 Replies)
Discussion started by: eee
0 Replies
5. UNIX for Advanced & Expert Users
i am new one to tcl/tk
OTP-ARB:/home/ponmuthu/tcl=>/usr/bin/tclsh
tclsh tclsh8.4
OTP-ARB:/home/ponmuthu/tcl=>/usr/bin/tclsh
% wish
Application initialization failed: no display name and no $DISPLAY environment variable
when i give like that i am getting error Application... (0 Replies)
Discussion started by: ponmuthu
0 Replies
6. Shell Programming and Scripting
Hi ,
I am having one File "free" contents are like this
module KANDI ( DQS2SD0,.DQW09X2SEL2(... (0 Replies)
Discussion started by: kshitij
0 Replies
7. Shell Programming and Scripting
Hello,
Can someone explaine me the meaning of this program:
#! /usr/bin/tclsh
set mctal
set a
set b
set c
set d
set e
while {! line cell]} {
}
while {! line]} {
}
while {! line cell]} {
}
while {! line]} {
} (0 Replies)
Discussion started by: jolecanard
0 Replies
8. Shell Programming and Scripting
Does any one know how to capture the output of command called from a TCL script?
I cannot figure this out. I've been working on it for 4 hours now :confused: (2 Replies)
Discussion started by: Lorna
2 Replies
9. Shell Programming and Scripting
Hello Tcl Experts,
set i 0
while { $i < 10 } {
puts "$i"
incr i
}
I am trying to print the value of "i" at the same place. i.e. it should first print "1", then in next iteration print "2" over the location of "1" and so on.... (i.e. in every iteration, delete the previous number and... (2 Replies)
Discussion started by: sumitgarg
2 Replies
10. Shell Programming and Scripting
can someone tell my why the puts is not reflecting the variable?
CUT -->
set fp
while {-1 != } {
button .a${line} -text "${line} " -width 20 -command {
puts $line
}
pack .a${line}
} (0 Replies)
Discussion started by: hpuxrox
0 Replies
lindex(n) Tcl Built-In Commands lindex(n)
__________________________________________________________________________________________________________________________________________________
NAME
lindex - Retrieve an element from a list
SYNOPSIS
lindex list ?index...?
_________________________________________________________________
DESCRIPTION
The lindex command accepts a parameter, list, which it treats as 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 presented as a single argument. |
If no indices are presented, the command takes the form: |
lindex list |
or |
lindex list {} |
In this case, the return value of lindex is simply the value of the list parameter. |
When presented with a single index, the lindex command treats list as a Tcl list and returns the index'th element from it (0 refers to the
first element of the list). In extracting the element, lindex observes the same rules concerning braces and quotes and backslashes as the
Tcl command interpreter; however, variable substitution and command substitution do not occur. If index is negative or greater than or
equal to the number of elements in value, then an empty string is returned. If index has the value end, it refers to the last element in
the list, and end-integer refers to the last element in the list minus the specified integer offset.
If additional index arguments are supplied, then each argument is used in turn to select an element from the previous indexing operation, |
allowing the script to select elements from sublists. The command, |
lindex $a 1 2 3 |
or |
lindex $a {1 2 3} |
is synonymous with |
lindex [lindex [lindex $a 1] 2] 3 |
EXAMPLES
|
lindex {a b c} => a b c |
lindex {a b c} {} => a b c |
lindex {a b c} 0 => a |
lindex {a b c} 2 => c |
lindex {a b c} end => c |
lindex {a b c} end-1 => b |
lindex {{a b c} {d e f} {g h i}} 2 1 => h |
lindex {{a b c} {d e f} {g h i}} {2 1} => h |
lindex {{{a b} {c d}} {{e f} {g h}}} 1 1 0 => g |
lindex {{{a b} {c d}} {{e f} {g h}}} {1 1 0} => g |
SEE ALSO
list(n), lappend(n), linsert(n), llength(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n) |
KEYWORDS
element, index, list
Tcl 8.4 lindex(n)