Question: (Closed) Bash Script prints out Command
gravatar for rodrigo.nicodemos82
5.5 years ago by
United States
rodrigo.nicodemos8210 wrote:


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:



    echo "This is a Test:"


    echo genomeCoverageBed -ibam $BAM_FILE -bg > WT_Rep_1_genomecov.bedgraph


Thank you.


bash coverage genome • 1.7k views
ADD COMMENTlink modified 5.5 years ago by Alex Reynolds31k • written 5.5 years ago by rodrigo.nicodemos8210

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.

ADD REPLYlink modified 5.5 years ago • written 5.5 years ago by Daniel Swan13k
gravatar for iraun
5.5 years ago by
iraun3.8k wrote:

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.

ADD COMMENTlink modified 5.5 years ago • written 5.5 years ago by iraun3.8k
Please log in to add an answer.
The thread is closed. No new answers may be added.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1011 users visited in the last hour