- Piping two bash commands in R: broken pipe error
- #Create a long file (2GB on your drive...)
- write.csv(rep(1,1E8),file="long.txt", row.names=FALSE)
- system("grep 1 tmp.txt") #This works
- system("grep 1 tmp.txt| head -n 10") #This gives a broken pipe error
- system("grep 1 tmp.txt 2>/dev/null | head -n 10")