# get password from user if test -t 0 then # a terminal user trap 'trap "" 2 3 15; stty echo; exit 1' 2 3 15 stty -echo # turn off echoing echo "Password: \\c" read PASSWORD || { stty echo; exit 1; } stty echo # turn echoing back on trap 2 3 15 echo # echo user's newline else # not a terminal read PASSWORD || exit 1 fi mainunitfiles() { for d do sed -n -e \ 's!^\*\** \([^A-Z].*\)!'"${d}"'/\1.txt!p' \ ${d}/Outline-files.txt done } allunitfiles() { for d do echo ${d}/Outline-files.txt \ `mainunitfiles $d` done }