[R] Error: ignoring SIGPIPE signal

Farid Cheraghi |@r|dcher @end|ng |rom gm@||@com
Tue Mar 16 15:49:23 CET 2021


Hi,

```R
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux bullseye/sid

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C
               LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base

other attached packages:
[1] colorout_1.2-2

loaded via a namespace (and not attached):
[1] compiler_4.0.3
```

What is wrong with the following Shell script that gives the error? If
you decrease the sequencing number from 50 to e.g. 10 the error might
disappear!

```bash
seq 50 | Rscript -e "cat(readLines(file('stdin')), sep='\n')" | head -n 2
1
2
Error in cat(readLines(file("stdin")), sep = "\n") :
  ignoring SIGPIPE signal
Execution halted
```

It is already asked on StackOverflow without a good answer:
https://stackoverflow.com/questions/28915838/piping-rscript-gives-error-after-output

thanks,
Farid



More information about the R-help mailing list