title: Simple commands not found bash (#!/usr/bin/expect)
body: <p>I've recently started using bash to automate a windows rescue disk with <code>chntpw</code>. I'm trying to set up the program to use the <code>expect</code> command to listen for certain <code>chntpw</code> dialog questions and input the right answers without any user input. For some reason after setting up the bash script to use <code>#!/usr/bin/expect</code> rather than <code>#!/bin/bash</code> then many standard terminal commands are no longer understood.</p>
  
  <p>I'm running the script by typing this into terminal:</p>
  
  <pre><code>user@kali:~/Desktop/projects/breezee$ bash breezee1.sh
  </code></pre>
  
  <p>The terminal output is as follows:</p>
  
  <pre><code>BREEZEE 1.0
  Welcome to BREEZEE
  breezee1.sh: line 9: fdisk: command not found
  [Select] /dev/:
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>#!/usr/bin/expect
  clear
  echo "BREEZEE 1.0"
  echo "Welcome to BREEZEE"
  
  fdisk -l 
  #list partitions
  echo -n "[Select] /dev/:"
  #ask user to choose primary windows partition
  read sda
  clear
  
  echo /dev/$sda selected
  
  umount /dev/$sda
  sudo ntfsfix /dev/$sda
  sudo mount -t ntfs-3g -o remove_hiberfile /dev/$sda /mnt/
  cd /mnt/Windows/System32/config
  
  clear
  chntpw -l SAM #list accounts on windows partition
  chntpw -u Administrator SAM
  #now supply chntpw with values to run the password clear (this answers the prompts)
  
  expect '&gt; ' 
  send '1\r'
  expect '&gt; '
  send '2\r'
  expect '&gt; '
  send '3\r'
  expect ': '
  send 'y\r'
  expect '&gt; '
  send 'q\r'
  expect ': '
  send 'y\r'
  
  clear
  echo "Operation Successfull!"
  chntpw -l SAM #list accounts on windows partition
  </code></pre>
  
  <p>In short, I'm trying to use standard bash/terminal commands alongside the <code>expect</code> commands. I'm probably going about this all wrong, so please correct me as I've been troubleshooting this for about three days and haven't gotten far :(</p>