problem in automating "fdisk" command using send and expect

view full story

http://www.unix.com – hi i want to automate fdisk command . i spawned a process containing fdisk command from a process and tried to send the options to fdisk promt from that process. but that spawed process is notstarting itself help me out trying for two days :wall: my code: Code: #!/bin/bash echo starting in send cat <<EOF > /root/test_ntp/send1 #!/usr/bin/expect -f spawn sh spawn_process send -- "m\n" send -- "l\n" send -- "q\n" EOF chmod 755 send1 ./send1 rc=$? if [ $rc -ne 0 ] then   echo failed else   echo passed fi echo done in send (HowTos)