How do you put the Bash arguments right? Shell's a scrup?



  • ls *.fastq | xargs -I  ./bbmap.sh
    

    How is it right to put the arguments of this scruple? There are two of them.

    One, not one, it works...

    ./bbmap.sh ref=ref.fa # creating index file from the input reference
    

    ./bbmap.sh in=SRR1163136.fastq out=mapped.sam # performing mapping/alignment and producing SAM output



  • Use: http://rtfm.co.ua/bash-funkciya-getopts-ispolzuem-opcii-v-skriptax/

    Summary example:

    #!/bin/bash
    while getopts "abc" opt
    do
     case $opt in
      a) echo "Found option $opt";;
      b) echo "Found option $opt";;
      c) echo "Found option $opt";;
     esac
    done
    

    There's a cycle that starts. getopts With a list of allowed options, "abc." Variables are assigned $optwhich is processed case




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2