(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
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
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
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 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
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
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 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
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
#!/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
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
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
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/^\*
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
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-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
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,
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 #单引号里的任何字符都会原样输出,
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.