I am generating a shell cut command with a series of arguments parsed from a file header.
the output of the command it redirected to a file:
cut -f 1-9,14,15 input_file > output_file
I can print the command itself into a file called mycutcommand.sh and attempt to run it from Julia:
The script finishes with ProcessExited(0) but the output file is nowhere to be found. If I run the shell command directly it works OK. What am I doing wrong?
Here is the complete script:
query = readlines(ARGS) #selected sample names samplearray = split(read(pipeline(`head -11 $(ARGS)`,`tail -1`),String),r"\t") mycutcommand = "cut -f 1-9," for i in query global mycutcommand = mycutcommand * string(findall(j -> j == i, samplearray)) * "," end myc = replace(mycutcommand, r",$" => " ") * string(ARGS) * " > select.vcf" commandfile = open("cutcommand.sh","w") write(commandfile,myc) mycmd = run(`sh ./cutcommand.sh`)