Skip to content
Tcl Source Code History Of Ticket 773280ffffffffff
Login

History Of Ticket 773280ffffffffff

Artifacts Associated With Ticket 773280ffffffffff

  1. Ticket change [98654f86a9] (rid 110599) by sea001 on 2003-07-17 21:29:14:

    1. assignee initialized to: "nijtmans"
    2. cmimetype initialized to: "text/plain"
    3. 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)
      
      
    4. foundin initialized to: "obsolete: 8.3.4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "sea001"
    9. subsystem initialized to: "14. List Object"
    10. title initialized to: "lindex bug"
    11. type initialized to: "Bug"
  2. Ticket change [3ef659c3ad] (rid 121365) by hobbs on 2003-07-18 04:53:14:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      Looks like the lindex isn't being done on a proper list.
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. username: "hobbs"
  3. Ticket change [f7cfb5c780] (rid 91435) by kennykb on 2003-07-18 05:06:31:

    1. closedate changed to: "2003-07-17T22:06:31"
    2. closer changed to: "kennykb"
    3. 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.
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "kennykb"
  4. Ticket change [dfdda2ef75] (rid 115091) by sea001 on 2003-07-18 05:13:27:

    1. 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!!!
      
      
      
    2. login: "sea001"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "sea001"
  5. Ticket change [2cd3dd580f] (rid 118978) by kennykb on 2003-07-18 05:24:36:

    1. closedate changed to: "2003-07-17T22:24:36"
    2. closer changed to: "kennykb"
    3. 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]
      
      
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "kennykb"
  6. Ticket change [a5f4b014aa] (rid 98518) by sea001 on 2003-07-18 05:44:28:

    1. icomment:
      Logged In: YES 
      user_id=825002
      
      Thank you!
      
      
    2. login: "sea001"
    3. mimetype: "text/plain"
    4. resolution changed to: "Accepted"
    5. username: "sea001"