Subject: bug#15414: 24.3; piping problems in eshell

From: Joseph Mingrone <[email-masked]>
Date: Sat, 21 Sep 2013 20:41:58 -0300

Glenn Morris <[email-masked]> writes:
> Maybe pipe cat to cat -v -n, and see what goes missing / gets added?

% cat test.in | cat -v > test.out
% diff test.in test.out

The diff shows that test.out gets truncated after 1984 characters
(that's what wc -m test.out reports).

The contents of test.in, test.out and the diff follow.

Joseph

---------------------- test.in ----------------------
// Stat2080 Assignment 8  Winter 2012/2013

// Question 2a

/LET itX = mathBeg_m+"X"+mathEnd_m
/LET itY = mathBeg_m+"Y"+mathEnd_m
/LET itSSxx = mathBeg_m+"SS"+mathEnd_m+subBeg_m+"xx"+subEnd_m
/LET itSSyy = mathBeg_m+"SS"+mathEnd_m+subBeg_m+"yy"+subEnd_m
/LET itSSxy = mathBeg_m+"SS"+mathEnd_m+subBeg_m+"xy"+subEnd_m
/LET itH0 = mathBeg_m+"H"+mathEnd_m+subBeg_m+"0"+subEnd_m
/LET itHa = mathBeg_m+"H"+mathEnd_m+subBeg_m+"a"+subEnd_m
/LET itF = mathBeg_m+"F"+mathEnd_m

/LET n = 10
/LET xm = 5.
/LET ym = 12.
/LET SSxy = 121.+random(1,8)
/LET SSxx = 136.+random(1,8)
/LET SSyy = 155.
/LET b1 = SSxy/SSxx	// beta1_hat
/LET b0 = ym-b1*xm	// bet0_hat
/LET b1 = roundto(b1,2)
/LET b0 = roundto(b0,2)

/LET dft = n-1
/LET dfr = 1
/LET dfe = dft-dfr
/LET SSR = SSxy*SSxy/SSxx
/LET SST = SSyy
/LET SSE = SST-SSR
/LET MSR = SSR/dfr
/LET MSE = SSE/dfe
/LET R2  = SSR/SST
/LET SEb1= sqrt(MSE/SSxx)

A straight line is fitted to some data using least squares and the following summary statistics:/DIS(newLine_m)
/DIS(n_gw+eq_m)/DIS(n),/DIS(hSpace1_m) /DIS(xbar_gw+eq_m)/DIS(xm:0f),/DIS(hSpace1_m) /DIS(ybar_gw+eq_m)/DIS(ym:0f),/DIS(hSpace1_m) 
/DIS(itSSxy+eq_m)/DIS(SSxy:0f), /DIS(newLine_m) /DIS(itSSxx+eq_m)/DIS(SSxx:0f),/DIS(hSpace1_m) /DIS(itSSyy+eq_m)/DIS(SSyy:0f)./DIS(newLine_m)
The least squares intercept and slope are /DIS(b0:2f) and /DIS(b1:2f), respectively, and the ANOVA table is 
/DIS(vSpace10_m)
/DIS(web("","\begin{tabular}{|l|c|c|c|} \hline","<table border='1' cellpadding='4'><tr><th>")) \
Source /DIS(seph_m) DF /DIS(seph_m) SS /DIS(seph_m) MS 
/DIS(nllh_m)
/DIS(web("","","<tr align='center'><td>")) \
Regression /DIS(sep_m) /DIS(dfr) /DIS(sep_m) /DIS(SSR:2f) /DIS(sep_m) /DIS(MSR:2f) /DIS(nll_m)
/DIS(web("","","<tr align='center'><td>")) \
Residual /DIS(sep_m) /DIS(dfe) /DIS(sep_m) /DIS(SSE:2f) /DIS(sep_m) /DIS(MSE:2f)  /DIS(nll_m)
/DIS(web("","","<tr align='center'><td>")) \
Total /DIS(sep_m) /DIS(dft) /DIS(sep_m) /DIS(SST:2f)/DIS(sep_m)/DIS(nbsp_m) /DIS(nll_m)
/DIS(web("","\end{tabular}","</table>"))
/DIS(vSpace10_m)

/LET xstar = random(7,10)
/LET yhat = b0+b1*xstar

/IMP "/dalphysicslib/Tools/Problem"
What is the estimated mean value for /DIS(y_gw) when /DIS(x_gw+eq_m)/DIS(xstar)?

/ANS(yhat:2f, tol=0.03, wgt=wgt_v, tries=tries_v)

/LET yhat = random(18,22)
/LET xstar = (yhat-b0)/b1

/IMP "/dalphysicslib/Tools/Problem"
If the fitted value for /DIS(y_gw) is /DIS(yhat), what is the corresponding value for /DIS(x_gw)?

/ANS(xstar:2f, tol=0.03, wgt=wgt_v, tries=tries_v)

/LET percent = R2*100

/IMP "/dalphysicslib/Tools/Problem"
What percent of the variation in /DIS(y_gw) is explained by the regression in /DIS(x_gw)? Enter an integer, without the /DIS(pct_u) sign.

/ANS(percent:0f, tol=0.6, wgt=wgt_v, tries=tries_v)

/IMP "/dalphysicslib/Tools/Problem"
What is the standard error of the slope estimate? Enter 3 decimals.

/ANS(SEb1:3f, tol=0.01, wgt=wgt_v, tries=tries_v)

---------------------- test.out ----------------------
// Stat2080 Assignment 8  Winter 2012/2013

// Question 2a

/LET itX = mathBeg_m+"X"+mathEnd_m
/LET itY = mathBeg_m+"Y"+mathEnd_m
/LET itSSxx = mathBeg_m+"SS"+mathEnd_m+subBeg_m+"xx"+subEnd_m
/LET itSSyy = mathBeg_m+"SS"+mathEnd_m+subBeg_m+"yy"+subEnd_m
/LET itSSxy = mathBeg_m+"SS"+mathEnd_m+subBeg_m+"xy"+subEnd_m
/LET itH0 = mathBeg_m+"H"+mathEnd_m+subBeg_m+"0"+subEnd_m
/LET itHa = mathBeg_m+"H"+mathEnd_m+subBeg_m+"a"+subEnd_m
/LET itF = mathBeg_m+"F"+mathEnd_m

/LET n = 10
/LET xm = 5.
/LET ym = 12.
/LET SSxy = 121.+random(1,8)
/LET SSxx = 136.+random(1,8)
/LET SSyy = 155.
/LET b1 = SSxy/SSxx	// beta1_hat
/LET b0 = ym-b1*xm	// bet0_hat
/LET b1 = roundto(b1,2)
/LET b0 = roundto(b0,2)

/LET dft = n-1
/LET dfr = 1
/LET dfe = dft-dfr
/LET SSR = SSxy*SSxy/SSxx
/LET SST = SSyy
/LET SSE = SST-SSR
/LET MSR = SSR/dfr
/LET MSE = SSE/dfe
/LET R2  = SSR/SST
/LET SEb1= sqrt(MSE/SSxx)

A straight line is fitted to some data using least squares and the following summary statistics:/DIS(newLine_m)
/DIS(n_gw+eq_m)/DIS(n),/DIS(hSpace1_m) /DIS(xbar_gw+eq_m)/DIS(xm:0f),/DIS(hSpace1_m) /DIS(ybar_gw+eq_m)/DIS(ym:0f),/DIS(hSpace1_m) 
/DIS(itSSxy+eq_m)/DIS(SSxy:0f), /DIS(newLine_m) /DIS(itSSxx+eq_m)/DIS(SSxx:0f),/DIS(hSpace1_m) /DIS(itSSyy+eq_m)/DIS(SSyy:0f)./DIS(newLine_m)
The least squares intercept and slope are /DIS(b0:2f) and /DIS(b1:2f), respectively, and the ANOVA table is 
/DIS(vSpace10_m)
/DIS(web("","\begin{tabular}{|l|c|c|c|} \hline","<table border='1' cellpadding='4'><tr><th>")) \
Source /DIS(seph_m) DF /DIS(seph_m) SS /DIS(seph_m) MS 
/DIS(nllh_m)
/DIS(web("","","<tr align='center'><td>")) \
Regression /DIS(sep_m) /DIS(dfr) /DIS(sep_m) /DIS(SSR:2f) /DIS(sep_m) /DIS(MSR:2f) /DIS(nll_m)
/DIS(web("","","<tr align='center'><td>")) \
Residual /DIS(sep_m) /DIS(dfe) /DIS(sep_m) /DIS(SSE:2f) /DIS(sep_m) /DIS(MSE:2f)  /DIS(nll_m)
/DIS(web("","","<tr align='center'><td>")) \
Total /DIS(sep_m) /DIS(dft) /DIS(sep_m) /DIS(SST:2f)/DIS(sep_m)/DIS(nbsp_m) /DIS(nll_m)
/DIS(we

---------------------- diff output ----------------------
diff -c /home/jrm/test.in /home/jrm/test.out
*** /home/jrm/test.in	2013-09-21 20:31:23.000000000 -0300
--- /home/jrm/test.out	2013-09-21 20:32:06.000000000 -0300
***************
*** 47,79 ****
  Residual /DIS(sep_m) /DIS(dfe) /DIS(sep_m) /DIS(SSE:2f) /DIS(sep_m) /DIS(MSE:2f)  /DIS(nll_m)
  /DIS(web("","","<tr align='center'><td>")) \
  Total /DIS(sep_m) /DIS(dft) /DIS(sep_m) /DIS(SST:2f)/DIS(sep_m)/DIS(nbsp_m) /DIS(nll_m)
! /DIS(web("","\end{tabular}","</table>"))
! /DIS(vSpace10_m)
! 
! /LET xstar = random(7,10)
! /LET yhat = b0+b1*xstar
! 
! /IMP "/dalphysicslib/Tools/Problem"
! What is the estimated mean value for /DIS(y_gw) when /DIS(x_gw+eq_m)/DIS(xstar)?
! 
! /ANS(yhat:2f, tol=0.03, wgt=wgt_v, tries=tries_v)
! 
! /LET yhat = random(18,22)
! /LET xstar = (yhat-b0)/b1
! 
! /IMP "/dalphysicslib/Tools/Problem"
! If the fitted value for /DIS(y_gw) is /DIS(yhat), what is the corresponding value for /DIS(x_gw)?
! 
! /ANS(xstar:2f, tol=0.03, wgt=wgt_v, tries=tries_v)
! 
! /LET percent = R2*100
! 
! /IMP "/dalphysicslib/Tools/Problem"
! What percent of the variation in /DIS(y_gw) is explained by the regression in /DIS(x_gw)? Enter an integer, without the /DIS(pct_u) sign.
! 
! /ANS(percent:0f, tol=0.6, wgt=wgt_v, tries=tries_v)
! 
! /IMP "/dalphysicslib/Tools/Problem"
! What is the standard error of the slope estimate? Enter 3 decimals.
! 
! /ANS(SEb1:3f, tol=0.01, wgt=wgt_v, tries=tries_v)
--- 47,50 ----
  Residual /DIS(sep_m) /DIS(dfe) /DIS(sep_m) /DIS(SSE:2f) /DIS(sep_m) /DIS(MSE:2f)  /DIS(nll_m)
  /DIS(web("","","<tr align='center'><td>")) \
  Total /DIS(sep_m) /DIS(dft) /DIS(sep_m) /DIS(SST:2f)/DIS(sep_m)/DIS(nbsp_m) /DIS(nll_m)
! /DIS(we
\ No newline at end of file

Diff finished.  Sat Sep 21 20:38:34 2013