Entering edit mode
3.6 years ago
evafinegan
•
0
Hello,
I am trying to make an object for a list of fasta files to use for downstream analysis:
INPUT_DIR=/path/input
INPUT_FILE=$(ls -1 input/*.fasta)
SAMPLE=$(basename "${INPUT_FILE}" .fasta)
in=${INPUT_DIR}/${SAMPLE}.fasta
However in
shows only the first file in the list instead of all the fasta files.
Thank you for the help!
If this is bash script, this is unnecessarily complex. Let us say you have all the fasta files in
test
directory, want to usels
for listing files and store the file information along with directory (test
here). You can create an array and use the array elements as you like.you can also loop through array:
All string manipulations work on arrays and list items. works with bash on ubuntu.
It worked. thank you!
When assigning multiple strings (files) separated with space in shell, only the first value is assigned.
You would use
for
orwhile
loop ,find --exec
, parallel, orxargs
to process every file separately.