1. 清空文件
cat /dev/null > file.name
2. 实现输入不提示代码
cat /dev/null > file.name
2. 实现输入不提示代码
#! /bin/sh
printf “Enter your password:”
stty –echo
read password < /dev/tty
printf “\nEnter again:”
read password2 < /dev/tty
stty echo
printf “\n”
echo “password 1 is : $password”
echo “password 2 is : $password2”