Accepting passwords discreetly in scripts by turning off echo


Use this code to prompt for passwords. When the user types, nothing will be displayed, so anyone looking over the user's shoulder won't see what has been typed.
  echo "Enter admin's password for the hosts: "
  stty -echo
  read pw
  stty echo

01/03/2008