笔试练习(三): 21.编写shell程序,实现自动删除30个账号的功能. 账号名为std01至std30. [root@VM_0_5_centos test]# vi 21.sh [root@VM_0_5_centos test]# cat 21.sh #!/bin/bash #编写shell程序,实现自动删除30个账号的功能.账号名为std01至stud30 #要有root权限 for i in {9901..9930}; do xx=`echo $i | sed 's/99//g'` us…
笔试练习(一): 1.求2个数之和 [root@VM_0_5_centos test]# vi 1.sh [root@VM_0_5_centos test]# cat 1.sh #! /bin/sh first=0 second=0 read -p "Input the first number: " first read -p "Input the second number: " second result=$[$first+$second] echo &quo…
原文链接: Shell编程 打算有时间简单了解shell编程 1.shell结构 一个简单的例子: [root@localhost shell]# vi example #!/bin/sh #This is show what a example looks like. echo "my first shell example." echo # this inserts an empty line in output. echo "We are current in the…