Bash Script prints out Command
Hello,
I am new to creating bash scripts to run commands. I've tried to run this simple bash script to calculate the genome coverage of a bam file I have using the bedTools genomeCoverageBed command. I am not sure what I am doing wrong, but when I run this script I can a file that contains the printed command.
Here is my script:
#!/bin/bash
echo "This is a Test:"
BAM_FILE=/RNA-seq/TopHat_Output/WT_Rep_1_accepted_hits_sorted.bam
echo genomeCoverageBed -ibam $BAM_FILE -bg > WT_Rep_1_genomecov.bedgraph
Thank you
Rodrigo
• 2,416 views
•
link
1 answer
You are getting the command printed out inside WT_Rep_1_genomecov.bedgraph file, right?
That is because the echo at the beginning of the line. Writing echo before the command that you want to run, actually you are printing the command itself. Remove echo and run it again.
• 0 views
•
link
Log in to answer this question.
Hello rodrigo.nicodemos82!
We believe that this post does not fit the main topic of this site. This is not a bioinformatics question sorry. You really need to do a 10 minute bash primer online.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.