system() command in unix: awk and grep errors

grep:
grep doesn’t seem to work, giving the error code below, even though the same commands works fine when used outside of mothur.

mothur > system(grep -Ev ',' namefile.names > output_file)
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file

awk:

Works (printing one column):

mothur > system(awk '!($2="")' otu_taxonomy_table.taxonomy > output_file)
mothur > system(awk '!($2=$3="")' otu_taxonomy_table.taxonomy > output_file)

mothur > system(awk '{print $1}' otu_taxonomy_table.taxonomy > output_file)

Doesn’t work (printing two columns):

mothur > system(awk '{print $1, $3}' otu_taxonomy_table.taxonomy > output_file)
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file

Works: (same command, outside of mothur)

-bash-4.1$ awk '{print $1, $3}' otu_taxonomy_table.taxonomy > output_file

Thanks for reporting this. I will look into it.