Shell's basic script exercise collection

Exercise 1 Display ip and host name

Create a script ip_show.sh, so that the execution of this script can display the current ip and host name

Insert picture description here

Exercise 2 Display host name+ip+login user

Create a script host_messages.sh so that the execution of this script can display the current host name, ip, and users who log in to the host
Insert picture description here

Exercise 3 Clear log

Create a script clear_log.sh, so that the execution of this script can clear the log
Insert picture description here

Exercise 4 User creation

Create a script create_user.sh, execute this script to create all users in the file username after the script
Insert picture description here
Insert picture description here

Exercise 5 User Control (Create + Delete)

Create a script userctrl.sh so that executing userctrl.sh delete user1 will delete user1; executing userctrl.sh add user1 will create user1
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_42958401/article/details/108473236