I'm trying to get the basenames of some files and combine them in an output file within a loop. I'm trying to assign the basenames to variables 'x' and 'y' but keep getting the error "x: command not found". Why does bash think 'x' and 'y' are commands and what is the best way to get both file names (but not paths or extensions) in the output file? Thanks for any help!
for i in ~/SOSP/pops/*.txt
do
x = $(basename $i)
for j in ~/SOSP/pops/*.txt
do
y = $(basename $j)
vcftools --vcf ~/SOSP/sosp.vcf --weir-fst-pop $i --weir-fst-pop $j --out ~/SOSP/fst_pairs/${x}_vs_${y}.txt
done
done