Thank you for the information. I ran fastqc on single file and it went well but it is giving an error if I use this array:
INPUT_DIR=/path/
OUT_DIR=/path/
RUN=${SLURM_ARRAY_TASK_ID}
INPUT=$(ls -1 $INPUT_DIR/*.fastq | sed -n ${RUN}p)
SAMPLE=$(basename ${INPUT} | sed 's/.fastq//')
fastqc -o ${OUT_DIR}/${SAMPLE}.fastqc.out -f ${INPUT_DIR}/${SAMPLE}.fastq
Error is: Specified output directory '' does not exist