[EMAIL PROTECTED] writes:

> system(..., intern=TRUE) splits long lines after 118th character and
> discards the 119th character 
> 
> > a <- paste(rep("a", 124), collapse="")
> > system(paste("echo", a), intern=TRUE)
> system(paste("echo", a), intern=TRUE)
> [1]
> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaa"
> 
> > 
> 
> The result is a vector of length 2 and it should be that of 1.

> major    1                
> minor    6.0              

Not so in 1.6.2:

> a <- paste(rep("a", 124), collapse="")
> system(paste("echo", a), intern=TRUE)
[1]
> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

You might at least have checked the NEWS file for 1.6.2:

    o   system(intern=TRUE) has an undocumented line length limit of
        119 chars both on Unix and Windows.  The limit is now 8096 and
        documented.  On Unix (only) every 120th character used to be
        discarded.



-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])             FAX: (+45) 35327907

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

Reply via email to