Shell grooming (35) = = = = = = Script for the simulated User login print menu

(a) Print a menu, accept an input, if there is no user to create a user and password, will create a user and password to write to a file, if there is a file to impersonate a user to log in, require the user name arbitrary, can be (^$ ^q), the

Linux shell script detects hard disk space mail alerts

Using http://www.weiruoyu.cn/?p=368Shell script monitors hard disk space remaining space email alerts1. First look at the disk, and how to use the script [[email protected] ~]# df -h File System                 capacity    used  

Shell format output nginx compiler parameters

CommandNginx-v > Nginx.txtcat-n nginx.txt | Sed-n ' 5,18p ' | awk ' {$1= ' ";p rint} ' | Sed ' s/^[]*//g ' | TR ' n ' ', ' | Sed-n ' S/,//GP ' | TR "" \ n

Shell programming Character intercept commands

awk commandawk ' Condition 1 (Action 1) Condition 2 (Action 2) ... ' FilenameCondition (pattern)General use of relational expressions as criteriaX>10 to determine if X is greater than 10x>=10 greater than or equal toxActions (Action)-Formatted

8-shell Integer Expression introduction-Practice and enterprise case Scripting anatomy

Integer two-dollar comparison operator The comparer used in [] and test The comparer used in (()) and [[]] Description -eq = = or = Equal abbreviations, equal -ne != Not equal

Shell Common Command Summary

Shell Common Command Summary1 ls command: List filesLs-la list all files and folders in the current directoryLS A * lists all files starting with the A letter in the current directoryLs-l *.txt lists all files with the suffix txt in the current

Shell script execution and configuration files

Linux shell script execution and configuration files Bash Script Execution method:1 interpreter runs/usr/bin/bash bash foo.sh 2 run script with path (requires x permission) chmod +x foo.sh/path/to/foo.sh 3 use. or so The Urce command executes

Considerations for using while loop ssh in the shell

Need to read a text, the second text each line contains an IP in the while loop using SSH, but after the first line of SSH exited, how to avoid automatically reading a line out of the while loop, this article will explain its reasons in

[Shell programming] File content case substitution

shell programming often encounters strings, file content-case conversions, and choosing the right commands in different scenarios can improve programming efficiency. Applicable Scenariosfile contents or strings that need to be converted to uppercase

Linux shell directives such as-D,-F,-E, and other judgment expressions

File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic link

How the shell generates random numbers

Method 1: Use/dev/urandom[[email protected] shell]# tr -dc  "0-9"   Method Two: Use Date +%s Randomly generate a bunch of numbers [Email protected]:/home/dell/shell# date +%s |cksum |cut-d ""-F 1 1934689009Expansion: Randomly generates

Shell Getopts Learning

#!/bin/bashwhile getopts I:VH Namedo case $name in i) Opt=1 echo $OPTARG;; V) opt=2 Echo 2;; h) opt=3 echo 3;; *) echo "Invalid arg-$OPTARG";; EsacdoneThe getopts is used in the following form:

Shell Programming for loop Summary

Shell Programming for loop Summary In shell programming, the execution of a loop is repeated several times for a piece of code, a common loop has a for, while, and a until loop, where the for loop is often used for finite cycles, and the

Shell command ls

Name: lsFeatures: View a list of files1[Email protected]6380-mt:~$ls2Add-on.yaml Desktop examples.desktop meta-gnome3-3.8+4UBUNTU3 PERL5 pycharm-2016.2.2 suVideos3Admin.conf docker-ce_17.03.1~ce-0~ubuntu-trusty_amd64.deb

Shell prompt Personalization

The specific meaning of the prompt can be consulted: http://billie66.github.io/TLCL/book/zh/chap14.htmlUbuntu16.04 personal configuration as follows, for later review1 functionGit_branch {2branch= "' Git branch 2>/dev/null | grep "^\*" | Sed-e "s/^\*

When to use shell scripts and when not to script

Because the shell appears to be a common feature between UNIX systems and is standardized by POSIX.As a result, shell scripts can be applied to many systems once they are "written attentively".Therefore, the shell script is used because of the

Shell programming--$ The meaning of numbers

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/D1/wKioL1mWuEXjPgg_AADSEroFgqw866.png "title=" Shell programming--$ The meaning of the number. png "alt=" Wkiol1mwuexjpgg_aadserofgqw866.png "/> $*  Same as the general directive,

The use of wget in the shell

The use of Wget-V Version Information-H Help Information-B Background Execution wget-o filename put the record in the file filename-a filename attaches the record to the file filename-D Display Debug information-Q No output download mode-v Verbose

Linux[Foundation]-05--powerful and usable shell

Powerful and usable shellComputer hardware is composed of arithmetic, controller, memory, input \ output device , etc.The system kernel is the role that makes the computer hardware perform its duties.The kernel is responsible for driving hardware,

Shell Getting Started Note 2: string, array, echo, and printf

DescriptionThis is a note about http://c.biancheng.net/cpp/shell/.Shell StringStrings can be in single or double quotes, or without quotation marks.1 #!/bin/bash 2 3 # #字符串 4 5 #不加引号: 6 #无法出现; 7 echo a 8 echo a;b 9 #单引号: One #单引号里的任何字符都会原样输出,

Total Pages: 541 1 .... 249 250 251 252 253 .... 541 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.