实用Shell代码工具记录

实用Shell代码工具记录
1. 清空文件
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”

你可能感兴趣的:(实用Shell代码工具记录)