I'm using this to wipe a USB flash drive and recreate a FAT filesystem:
dd if=/dev/zero of=/dev/sdb bs=1M #I don't need more advanced wiping
fdisk /dev/sdb
(a few keystrokes to select partition type, etc.)
mkfs.fat /dev/sdb1
The fact that I have to manually do a few keystrokes is annoying. How could I do all of this in one step, without any intervention? Something like:
dd if=/dev/zero of=/dev/sdb bs=1M && ??? &&& mkfs.fat /dev/sdb1