Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
System command - issues with grep and awk #315
Comments
mothur-westcott
added this to the
Back Burner
milestone
Mar 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mothur-westcott commentedMar 13, 2017
grep:
grep doesn't seem to work, giving the error code below, even though the same commands works fine when used outside of mothur.
CODE: SELECT ALL
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):
CODE: SELECT ALL
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):
CODE: SELECT ALL
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)
CODE: SELECT ALL
-bash-4.1$ awk '{print $1, $3}' otu_taxonomy_table.taxonomy > output_file