The other issue: when you exec a process like this, you no may longer have environment variables like PATH.
So, fully qualify each command and define PATH:
# examples - the paths may not be correct for
# your box
/usr/bin/dd if=/dev/zero of=$PATH bs=1024
/usr/sbin/mkswap $PATH $SIZE