用户操作_shell脚本

发布时间:2020-08-06 19:02:37 作者:byzmkb
来源:网络 阅读:333

工作环境:Red Hat Enterprise Linux Server release 6.5 (Santiago) 、 bash

#!/bin/bash
#
for i in `seq -w 1 10`
do
    echo "user$i添加成功"
    read -s -p "input passwd:" pass
        while [ ${#pass} -lt 6 ]
        do
            echo ""
            read -s -p "input passwd error ,the number of passwd must bigger than 6:" pass
            ((count++))
            if [ $count -gt 3 ];then
                echo "f**k you "
                exit
            fi
        done
    echo "$pass"
    read -p  "want to del the user (yes/no):" choice
    [ $choice == "yes" -o $choice == "y" ] && echo "del start"
    [ $choice == "no" -o $choice == "n" ] && echo "don't del"
    [ $choice != ^yes  -o $choice != ^no ]  && echo "please input (yes/no)!!!"
done

注意:只是简单的示例,并不会添加和删除用户

推荐阅读:
  1. 如何用powershell脚本查看用户的操作记录
  2. 【Linux】用户组、用户操作

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

shell

上一篇:SAP QM 如何在SAP系统里审批挂在Quality Notification里的document?

下一篇:微信经常延迟,收不到消息怎么办?赶紧自查这3个功能是不是开启

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》