Here is how my version of the script looks. I went through each necessary step individually, and left any step I didn't follow commented out in the script. Make any changes you need to:
lsblk
echo What drive would you like to use? Be careful. This tool can be system destroying. echo (e.g.\; /dev/sda1)
read DRIVE
echo CD to /tmp cd /tmp
echo Creating a Directory named \"flash\" mkdir flash
echo CD to /tmp/flash cd flash
echo 'Enter file size in Kilobytes (1000000000 = 1TB) : ';read FILESIZE
echo Creating MSDOS File System mkdosfs -C temp_file $FILESIZE
ls -lha
ls -sh
echo Unmounting $DRIVE
umount $DRIVE
ls -s temp_file
echo Requesting escalation to root \for \write to $DRIVE
sudo su
read DRIVE
head -c 244136K temp_file > $DRIVE
echo Write successful, de-escalating shell exit
sudo mount $DRIVE /media/joshd
df -h
sudo fdisk $DRIVE