Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d6638170b799423ccc248b10ee676805d3cac44e
Ticket: 813087ffffffffffffffffffffffffffffffffff
tclsh treats Unix pipelines as sockets
User & Date: dmacks on 2003-09-26 14:12:13
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    tcltk-8.4.1 compiled from the unix/ directory on OS X
    10.2.6.
    tcltk-8.3.4 that comes precompiled with my OS X is not
    affected.
    
    When tclsh is used in a pipeline, stdout is treated
    like a socket. This is bad because it defaults to CR/LF
    line endings, not the LF that is expected and
    appropriate for a Unix platform when parsing piped
    commands. Simple Unix file descriptor redirection does
    not have this problem.
    
    Here are three examples that look correct:
    
    % tclsh
    % fconfigure stdout
    -blocking 1 -buffering line -buffersize 4096 -encoding
    utf-8 -eofchar {} -translation crlf -mode 9600,n,8,1
    -xchar {p r}
    [that {p r} is actually untypable characters)
    
    % echo "puts [fconfigure stdout]" | tclsh
    -blocking 1 -buffering line -buffersize 4096 -encoding
    utf-8 -eofchar {} -translation crlf -mode 9600,n,8,1
    -xchar {p r}
    
    % echo "puts [fconfigure stdout]" | tclsh > foo ; cat
    -vte foo
    -blocking 1 -buffering line -buffersize 4096 -encoding
    utf-8 -eofchar {} -translation lf$
    
    So simple output and redirected output and piped input
    are okay, but if output is piped:
    
    % echo "puts [fconfigure stdout]" | tclsh | cat -vte 
    -blocking 1 -buffering line -buffersize 4096 -encoding
    utf-8 -eofchar {{} {}} -translation {auto crlf}
    -peername {0.0.0.0 0.0.0.0 0} -sockname {0.0.0.0
    0.0.0.0 0}^M$
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dmacks"
  9. subsystem changed to: "27. Channel Types"
  10. title changed to: "tclsh treats Unix pipelines as sockets"
  11. type changed to: "Bug"