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

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

bash coverage genome • 1.4k views
ADD COMMENTlink modified 4.2 years ago by Alex Reynolds28k • written 4.2 years ago by rodrigo.nicodemos8210
2

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 4.2 years ago • written 4.2 years ago by Daniel Swan13k
2
gravatar for iraun
4.2 years ago by
iraun3.6k
Norway
iraun3.6k 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 4.2 years ago • written 4.2 years ago by iraun3.6k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

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