I believe you are looking for something like this:
#!/bin/bash
## Set the scriptHeader variable to hold the SBATCH commands you need
read -r -d '' scriptHeader <<EoF
#!/bin/bash
#SBATCH line 1
#SBATCH line 2
#SBATCH line 3
EoF
stuffPath=/Where/My/Stuff/Is
samplePath=/Where/My/Samples/Are
outputPath=/Where/I/Want/NewFile/To/Go
while read sampleName; do
for ((chr=1; chr<=22; chr++)); do
command="$stuffPath/bcftools viewview"
$thisSamplePath inVCF="$thisSamplePath/$chr.vcf"
thisSamplePath="$samplePath/${sampleName}_Samples.txt"
thisOutputPath="$outputPath/${sampleName}_Chrom${chr}.vcf"
printf '%s\n%s "%s" -S "%s" -o "%s"\n' "$scriptHeader" \
"$command" \"$inVCF"\
"$thisSamplePath/$chr.vcf" \
"$thisOutputPath" > "$stuffPath/$sampleName.$chr.sh"
done
done < "$samplePath"/FullSampleList.txt
This will produce 22 files for each line in "$samplePath"/FullSampleList.txt. Each file will look like this:
#!/bin/bash
SBATCH line 1
SBATCH line 2
SBATCH line 3
/Where/My/Stuff/Is/bcftools view "/Where/My/Samples/Are/ACB_YRI_Samples.txt/6.vcfvcf" -S "/Where/My/Samples/Are/ACB_YRI_Samples.txt/6.vcf" -o "/Where/I/Want/NewFile/To/Go/ACB_YRI_Chrom6.vcf"