Posted to tcl by mr_calvin at Mon Jan 21 14:59:15 GMT 2019view raw

  1. % lmap fd [glob /proc/[pid]/fd/*] {if {[file exists $fd] && [string match pipe:* [file readlink $fd]]} { file tail $fd } else { continue }}
  2. % set pre [lmap fd [glob /proc/[pid]/fd/*] {if {[file exists $fd] && [string match pipe:* [file readlink $fd]]} { file tail $fd } else { continue }}]
  3. % open "|echo"
  4. file3
  5. % set post [lmap fd [glob /proc/[pid]/fd/*] {if {[file exists $fd] && [string match pipe:* [file readlink $fd]]} { file tail $fd } else { continue }}]
  6. 3
  7. % close $fh
  8. % set post2 [lmap fd [glob /proc/[pid]/fd/*] {if {[file exists $fd] && [string match pipe:* [file readlink $fd]]} { file tail $fd } else { continue }}]