Non-interactive fdisk partition in script

view story

http://www.unix.com – Hi, How can I run fdisk partition in a script without interactive input? In manual procedure, I run fdisk device, select n, select p, presess enter for default start number (1), press enter to default end number, then select w for writing to the partition table. The command looks like "fdisk -u -p ..... /dev/device" Thanks. Kind regards. (HowTos)