I have some odd behaviour occurring in my Python program.
perf_join_cmd = "join <(sort -k1,1 {}) <(sort -k1,1 {}) > {}.ScoreProfile"
perf_join_cmd = perf_join_cmd.format(meta, extracted_snps, out)
os.system(perf_join_cmd)
I am creating a string, passing in arguments to the string. The string represents a join/sort piped command to be ran on the shell, hence my call to os.system.
The error is:
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `join <(sort -k1,1 ../../ADHD_GWAS.tbl) <(sort -k1,1 ../adhd-c/bin/adhd-merged.subset) > adhd-c.ScoreProfile'
I've been hacking away at this for long enough and I don't see anything that looks like a syntax error - so I suspect there's something deeper happening here and I was hoping someone could shed some light.
As an FYI, this is the output of the perf_jon_cmd when printed:
join <(sort -k1,1 ../../ADHD_GWAS.tbl) <(sort -k1,1 ../adhd-c/bin/adhd-merged.subset) > adhd-c.ScoreProfile
Any help appreciated!
Thanks.
os.system(perf_join_cmd, shell=True)should solve it?/bin/bash -c, can you try that? stackoverflow.com/questions/21822054/…