正在加载图片...
调用该函数的方式。 zhaodongfeng a Teach Server: /shells bash choosemax. sh 34 6890 12 45 max value is: 90 三、Shel1编程案例一:用户管理 目的 编写She11脚本,实现通过参数定义用户名、口令,实现用户的 创建 案例: usermanage.sh #!/bin/bash surname is S sudo mkdir/home/Username sudo useradd Username -d/home/Username echo"Please change password for Suse sudo mkdir /home/Username sudo useradd Username -d/home/Username echo "Username is create success. ho "please cha d for Suser sudo passwd Username echo"your operate is cancel break 12《LInux操作系统》讲稿/河南中医学院/阮晓龙/rl@hactcm.edu.cn12 《Linux 操作系统》讲稿 / 河南中医学院 / 阮晓龙 / rxl@hactcm.edu.cn 调用该函数的方式。 zhaodongfeng@TeachServer:~/shell$ bash choosemax.sh 34 68 90 12 45 max value is:90. 三、Shell 编程案例一:用户管理 目的: 编写 Shell 脚本,实现通过参数定义用户名、口令,实现用户的 创建。 案例:usermanage.sh #!/bin/bash echo -n "Please input your username:" read username echo -n "your username is $username,are you sure?(y or n):" read usernamesure if [ "$usernamesure" = "y" ] then sudo mkdir /home/$username sudo useradd $username -d /home/$username echo "$username is create success." echo "Please change password for $username." sudo passwd $username elif [ "$usernamesure" = "Y" ] then sudo mkdir /home/$username sudo useradd $username -d /home/$username echo "$username is create success." echo "Please change password for $username." sudo passwd $username elif [ "$usernamesure" = "n" ] then echo "your operate is cancel." break elif [ "$usernamesure" = "N" ]
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有