In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to achieve crossword games in Linux". In daily operation, I believe that many people have doubts about how to achieve crossword games in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to achieve crossword games in Linux". Next, please follow the editor to study!
1. User build script
(1) Design document judgment module
(2) Design user to establish
(3) contents of the document
Script content
#! / bin/bashUSERADD () {# user-created function RN=$ (sed-n'$='$1) for ((iTun1) I/dev/null # determines whether the user exists [$?-eq 0] & & {echo "$user already exists"} | | {useradd $user # user echo "$password" in the new $user | passwd-- stdin $user & > / dev/null [$?-eq 0] & & {echo "$user user created successfully"}} done} # judgment module [$#-lt 2] & & {# determine whether the file is less than two echo "ERROR: number of files Insufficient! "} | {[- e $1-a-e $2] & {# determine whether a file exists # determine whether the number of lines of two files is equal [`USERADD-n'$='$1`-eq `sed-n'$='$2`] & & {USERADD $1 $2 # call user creation Function} | | {echo "ERROR: the number of file lines is inconsistent!"}} | {echo "ERROR: the file does not exist!"} 2. Word guessing game
#! / bin/bashNumber=7while truedo read-p "Please enter a number:" NUM if [$NUM = $Number] then echo "Congratulations, bingo!" Exit elif [$NUM-lt $Number] then echo-n "the number is too small!" Elif [$NUM-gt $Number] then echo-n "the number is too big!" Else echo-n "error" fidone3. Network card traffic monitoring
(1) judgment module
(2) display module
Clear the screen using the clear command
The output of the same line shows
(3) content of script
#! / bin/bash [- z $*] & & {echo "ERROR: Not input net device!"} | {Device= `ifconfig $* 2 > / dev/ null` & & {while true do RXpre=$ (cat / proc/net/dev | grep $1 | tr: "" | awk'{print $2}') TXpre=$ (cat / proc/net/dev | grep $1 | tr: "" | awk'{print $10}') # get the traffic sleep 1 RXnext=$ received and sent by the network port after 1 second (cat / proc/net/dev | grep $1 | tr: "| awk'{print $2}') TXnext=$ (cat / proc/net/dev | grep $1 | tr: "" | awk'{print $10}') # get the actual inbound and outbound traffic RX=$ ((${RXnext}-${RXpre})) TX=$ ((${TXnext}-${TXpre})) TX=$ (echo $TX | awk'{print $1max 1024 "KB/s"}') RX=$ (echo $RX | awk'{print $1max 1024 "KB/s"}') # refresh the monitoring display on the same line # echo-ne "input: $RX\ t\ toutput: $TX" # echo-ne "\ r" clear # display echo-ne "input: $RX\ noutput: $TX" after clearing the screen using clear Done} | | {echo "$1 is not exist"}} so far The study on "how to achieve crossword games in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.