Thank you for the link! I had a look and updated the script:
# Run featureCounts to generate a count matrix
$featurecounts -p -O -M -T 8 -a $gene_ann -F GTF -t exon -g gene_id -o $count_out/count_matrix.txt $bam_dir/*.bam
However, it is still showing as : ERROR: invalid parameter:/path/to/file/SRR7008461_aligned.bam'