#!/bin/bash read -p "the script will be installlamp,if you want to continue ,press yes :" press if [ $press == 
编写shell脚本,判断输入的IP是否正确(IP的规则是,n1.n2.n3.n4,其中1<n1<255, 0<n2<255, 0<n3<255, 0<n4<255)。#!/bin/bashcheck_ip(){if echo $1 | egrep -q "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$
批量新建用户uer1~user20,如果用户存在则提示用户已经存在,不添加;如果不存在则添加用户,并给该用户指定一个10位的随机密码,输出到某个文件中。#!/bin/bash # log=useradd.log echo "`date +%F-%T `try to add users.">> $log for&nbs
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号