Artifacts Associated With Ticket 773280ffffffffff
Ticket change [98654f86a9] (rid 110599) by sea001 on 2003-07-17 21:29:14:
- assignee initialized to: "nijtmans"
- cmimetype initialized to: "text/plain"
- comment initialized to:
tcl8.3.4 can't do an 'lindex $process 3' when process = '000 S taps 30416 30415 0 76 0 - 559 wait4 00:24 pts/4 00:00:00 sh -c (cd /usr/local/qt/doc/man && (echo ".ll 17.4i"; echo ".pl 1100i"; /bin/cat' tcl8.3.4 can't do an 'lindex $process 3' when process = '040 S taps 30417 30416 0 75 0 - 559 wait4 00:24 pts/4 00:00:00 sh -c (cd /usr/local/qt/doc/man && (echo ".ll 17.4i"; echo ".pl 1100i"; /bin/cat' (complains of semi colon following a double quote)
- foundin initialized to: "obsolete: 8.3.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "sea001"
- subsystem initialized to: "14. List Object"
- title initialized to: "lindex bug"
- type initialized to: "Bug"
Ticket change [3ef659c3ad] (rid 121365) by hobbs on 2003-07-18 04:53:14:
- assignee changed to: "kennykb"
- icomment:
Logged In: YES user_id=72656 Looks like the lindex isn't being done on a proper list.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
Ticket change [f7cfb5c780] (rid 91435) by kennykb on 2003-07-18 05:06:31:
- closedate changed to: "2003-07-17T22:06:31"
- closer changed to: "kennykb"
- icomment:
Logged In: YES user_id=99768 This is not a bug; [lindex] - and indeed all the list commands - are documented to require well-formed lists as their arguments. If you wish to separate a string into fields separated with whitespace, do something like [lindex [split $process { }] 3] Note that Tcl 7.6 is the last release in which this code would have worked - releases since then have attempted to parse the entire list when processing [lindex]. Please feel free to ask on comp.lang.tcl for additional information. - login: "kennykb"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "kennykb"
Ticket change [dfdda2ef75] (rid 115091) by sea001 on 2003-07-18 05:13:27:
- icomment:
Logged In: YES user_id=825002 original code was : set target 2012 if { [catch {exec ps -efl} processes } { puts "ERROR -- exec ps -efl failed -- $processes" } else { foreach process [split $processes "\n"] { set pid [lindex $process 3] if { $pid == $target } { puts "found it!" break } } } This works for all ps -efl output except the bug example. I've worked around it by simply 'catch {lindex $process 3} pid'. Sorry for the terse bug report -- I'm astonished you replied so quickly!!! - login: "sea001"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "sea001"
- icomment:
Ticket change [2cd3dd580f] (rid 118978) by kennykb on 2003-07-18 05:24:36:
- closedate changed to: "2003-07-17T22:24:36"
- closer changed to: "kennykb"
- icomment:
Logged In: YES user_id=99768 I still say we have a malformed list here. A list element may be surrounded by double quotes, but a list element surrounded by double quotes may not have spurious characters after it. A simpler example is: % lindex {"x"; "y"; "z"} 3 list element in quotes followed by ";" instead of space The correct way to deal with this sort of data would be to split the process line, replacing the [lindex $process 3] in your script with [lindex [split $process] 3] - login: "kennykb"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "kennykb"
Ticket change [a5f4b014aa] (rid 98518) by sea001 on 2003-07-18 05:44:28:
- icomment:
Logged In: YES user_id=825002 Thank you!
- login: "sea001"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- username: "sea001"
- icomment: