I am new to writing of bash scripts. I am making a pipeline for bioinformatic data-analysis. I am running several program fx Porechop, where I want to set a variable in the output name. So I want to be able to set a name of the sample, I am running and this name should then appear in the output files from every program.
So fare I have this script, but instead of outputting the name I gave, it tries to output the save path folder:
NAME=${1?Error: manlger directory til Nanopore fil(er)}
NAME2=${1?Error: ingen output fil angivet}
Now="$(date)"
#Porechop
$'/home/user/miniconda3/envs/pomoxis/bin/porechop' -i $NAME --threads 4 --check_reads 100 --discard_middle -o /media/user/new/porechop/trimmed_"$NAME2"_"$Now".fastq
The error is:
enter FileNotFoundError: [Errno 2] No such file or directory: '/media/user/new/porechop/trimmed_echo /media/user/new/b.frag/_Tue Feb 18 11:36:17 CET 2020.fastq'
I hope someone can help me to find a script to make this variable
-Sabine
$NAME2
expands toecho /media/user/new/b.frag/
. It comes from$1
. How do you call the script?