[] and [[]] can determine whether the variable is empty, [ $a] [[$a]] [ ! $a] [[! $a]] No differenceIn Linux, we can use the test command to determine if a string is empty, and the test command gives us the "-Z option" and the "-N option," which you
1.1 If statement(1) If conditional statement syntax: Single branch structureif [condition]ThenInstructionsFiOrif [Condition];thenInstructionsFiIf single branch condition Chinese programming Image grammarIf [you have a room]SoI'll marry you.Fruit
Exercise 1:User interaction ScriptsRequirements: write a script that, after execution, prints a line that says "Please input a number:", asks the user to enter a value, prints out the value, and then asks the user to enter the value again. Until the
Shell's variable functionVariables are an important part of the shell, and we know that Linux is a multiuser, multitasking environment where everyone gets a shell when they log into the system, and everyone can use Bash to execute mail to get their
1. Shell command IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the instruction entered by the user and sends it to the kernel for execution. A shell user
First, execute the command locally in JenkinsThe new project and git plug-ins in the same way, just choose the source control to use None, and then select the execute Shell module in the build , command to write the commands needed to execute
Introduction to the Shellzsh, ksh (yum list |grep zsh to be viewed and then installed accordingly )Command history1./root/.bash_history (this file holds the command we've knocked on)2. History (You can see how many of the commands we've used before.
Mass production of random character filenamesRequirement: Use the For loop to create 10 batches of HTML in the/oldboy directory. Each of these files needs to contain 10 random lowercase letters plus a fixed string of Oldboy.#!/bin/bash[!-d/oldboy] &&
Receiving user parameters#./example.sh One and threeThe Shell scripting language includes variables for receiving user parameters, and based on the above command, the commonly used variables are as follows:
Use $ A To get the file name of
Sometimes in some service management scripts to see the $ "$string", after some tests, found that the outside of the quotation marks is the same as No. Just turned the man bash and found an explanation.(1). If there is no special custom bash
20.5 logical judgments in shell scripts
If judgment
#if If the 1:if condition of the Chinese language; fi[[email protected] ~]# a=5;if [$a-gt 3];then echo OK; fiok; The reference text format is as follows: # !/bin/basha=5if [$a-gt 3]
First, ifSyntax format: If test-d $arg then ... else ... fiVariable test statements can be simplified with []. Example: test-d $arg equivalent to [-D $arg]. (Note: "Space" ["Space"-D "space"])For more test commands see: http://www.cnblogs.com/fangwu/
The main purpose of this blog post is to facilitate the installation of GNOME extensions for me and you. I've listed all the extensions I've installed here.
Common extensions
Clipboard Indicator
https://extensions.gnome.org/
The article is for personal opinion, please correct me.
Before we introduce the shell script, let's begin by understanding some basic concepts. What is a program? Process? The program is a set of instructions plus data, the following diagram
Regular Expressions (regular Express)The expression of a rule, which is to represent data with the same characteristics with some pre-defined symbols, almost all programming languages use regular expressions (regular) and are common in different
1. Execution style of the programProgram Programming Style:Past: Command-centric, data-serving instruction.Object type: Data-centric, instruction serves data.Program programming has the following characteristics:1) Sequential execution: refers to
One, parenthesis, parentheses ()1, single parenthesis ()① Command Group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in
For statementBasic format:For variable name in condition; Do ...; DoneExample: Traversing a directory or file#!/bin/bashcd/etc/# #脚本中如果查询的目录在多级目录下, first go to the directory, or directly with the absolute path for a in ' ls/etc/' # #遍历目录do if [-D $a
1. View the currently supported Shell (Linux)$ cat/etc/shells2. Change the shell currently in use$ chsh-s/bin/zsh$ chsh-s $ (which zsh)3. Compare the available zsh have oh my zshAutomatic installation$ wget
functionThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.Format: function F_name () {Command}The function must be placed first, and the
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