A script run well on R, but failed when it was executed using R q -e
from bash.
The script that run well on R was:
R> sizes <- read.table(pipe("ls -l /tmp | awk '!/^total/ {print $5}'"))
R> summary(sizes)
The command pattern from bash followed a previous discussion, but generated error messages:
R -q -e "x <- read.table(pipe("ls -l /tmp | awk '!/^total/ {print $5}'"));summary(x)"
awk: line 1: extra ')'
awk: line 1: extra ')'
awk: line 1: syntax error at or near ;
What's wrong with the above command?
root@kali:~# uname -a
Linux kali 3.18.0-kali3-586 #1 Debian 3.18.6-1~kali2 (2015-03-02) i686 GNU/Linux