"Must be finished this time" series? Section--linux SHELL script Raiders. (Manual cover face ...) )1, the simple start. -"The only way to learn a new programming language is to use it to program"Don't think too much, just tap the code:[Email
CCat Zdd Browse the contents of a ZDD fileCat Zdd1 Zdd2 Browsing the contents of multiple filesCat-n ZDD Browse the contents of a file Zdd and display line numbersCD back to the start directory, that is, just logged into the system directory, CD
(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
When using the shell, the environment variable file is read./etc/profile: This file sets the environment information for each user for the system, and the file is executed when the user logs on for the first time.and collect the shell settings from
Case 1: variables, functions, judgments, comparisonstest.sh[JavaScript]View PlainCopy
#!/bin/bash
Echo ======================== This is a bash demo========================
printf "%s is%d years old \ n" Zhengjinwei
DECLARE count=10
by Francis_hao Sep 30,2017Photo from reference "1"This article was authored by Liu Yinghao and licensed under the Creative Commons Attribution-NonCommercial use-Share 3.0 Chinese mainland license agreement in the same way. Welcome reprint, please
The shell function is similar to a shell script, which holds a series of instructions, but the Shell function is in memory, not the hard disk file, so it is fast, and the shell can preprocess the function, so the function starts faster than the
The origin of 3. shell basic knowledge 3.1 shell 3.1.1 bourne agin shell 3.1.2 the other shells, have zsh, ksh 3.2 see if shell 3.2.1 yum list | grep zsh 3.2.2 ls /root/.bash_history 3.2.3 echo $
The Shell's own abilities.Writing scripts is OK, at least now I'm running a script on the InternetProgram-Log scheduled backup and delete, NFS Shanghai volume file Delete and send mail."Data"Export
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
Logical symbols1. about the file and directory of the detection of Logical volume label!- F Common! Detect if "Archive" exists eg:if [-f filename]- D common! Detects if the directory exists- B detection is a "block file"- C detection is a
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
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
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
Environment variables in Linux include system-level and user-level, system-level environment variables are system variables to be read by every user logged into the system, and user-level environment variables are the environment variables that are
The idea is to learn the code creation is their own very like the first few lines of logic rigorous#!/bin/bash#判断两个整数的大小Read-p "Please enter two integers a B:" A B#或者使用a =$1[-Z "$a"]| | [-Z "$b"]&&{echo "The number you entered is zero"Exit
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
The C language implementation of the LS command under Linux (supports-R-parameters):#include #include #include #include #include #include #include void Do_ls (char *), void Do_stat (char *,char *); void Show_ File_info (char *,struct stat
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