Execute bash script on files in different folders
<p>I have several files with the same name in different folders. I want to execute my bash script to all of them in parallel. Is it possible to put them in a separate .txt file or in the same bash script and execute?i.e,</p>

<p>all.tab file</p>

<pre><code>path/to/set1/my.bam
path/to/set2/my.bam
path/to/set3/my.bam
</code></pre>

<p>and a bash,</p>

<pre><code>#!/usr/bin/env bash
#$ -q cluster_name
#$ -cwd
#$ -N job_name
#$ -e /path/to/log
#$ -o /path/to/log
#$ -l job_mem=16G
#$ -pe serial 4

PICARD="path/to/picard"
BAM="/path/to/all.tab"

echo "validating bam file"

$PICARD/picard.jar ValidateSamFile I=$BAM MODE=SUMMARY
</code></pre>

<p>So that it is going to launch several jobs to gueue in parallel and write log outputs or other output files in the respective folders.
If there is any other way, I appreciate any help.
EDIT: I invoke it as: qsub ./test.sh</p>