cat_vim_file.sh =============== #!/bin/bash usage() { echo "$1 <filename>" } FILENAME=$1 if [ "$FILENAME" == "" ]; then usage $0 elif [ -f ${FILENAME} ]; then echo -n "EnterPassword:" # Without echo (-s) read -s szPassword echo $szPassword| vim -es '+%print' '+:q!' $FILENAME else echo "FileNotFound: $FILENAME" usage $0 fi =============== Reference: https://stackoverflow.com/questions/3980668/how-to-get-a-password-from-a-shell-script-without-echoing