Tuesday, April 10, 2007

Prompting user for password in a shell script

echo "Enter Password"

# disable standard output
stty -echo

#prompt for password.
read password

#enable standard output
stty echo

echo $password

Wednesday, April 04, 2007

Redirecting standard output to file and console at the same time

Command Name: tee
Sample Usage: ls 2>&1 | tee ~/ls_output

Note: 2>&1 redirects standard error to standard output