There are many kinds of arithmetic operations in the shell, such as a=1,b=2, so how to calculate the value of A+b? Can not simply $a+ $B, if this operation, the result is 1+2, obviously not the result we want, the result is 3, we have a few methods:
Both exec and source belong to the Bash Internal command (builtins commands), where you can view all the internal command information by entering man exec or man source under bash.The bash shell commands are divided into two categories: external
Os:centos/redhat Seriesand tested properly on CentOS 6.7 and CentOS 7.2#!/bin/bash## auth:daxin# time:2018/07/10## nginx start Nginx Web server# # chkconfig:-90# Description:start, S Tops and reload Nginx Web server##
Five, Shell Process Control1. A heavy BranchIf statement syntax format:If conditionThenCommand1FiThe FI at the end is the if inverted.Write a line:if condition; Then Command1; Fi2. Two branchesIf ELSE syntax format:If
Shell Special Symbol Cut command* * indicates wildcard characters?? represents an arbitrary character# #号注释字符, the annotated content will not take effectThe \ \ symbol denotes the caret character, leaving the special symbol out of the original
Shell and shell scripting differencesShell: Refers to an application that provides an interface through which the operating system kernel services can beShell script: A script written for the shellExecution of Shell scriptsPass./execute instead of
Special symbols in the 1.linux shell(1) "*" represents 0 or more arbitrary symbols(2) "? "represents only one arbitrary symbol(3) "#" comment Description, "#" after the content will be ignored(4) "\" caret character, "\" After the special symbol
1. (1) Change the main prompt to the user's home directory name (hint: reference material 4.6.8 section environment variable PS1 and HOME usage)(2) Assign the string DOS file c:>\ $student \* to the variable x and display it (hint: note the choice
Shell Script Learning (i)A) Introduction to code-style shell scripts 1. Download Xshell 5 Build a folder Mkdri Home/data;1) Look at a 1.sh built in data See if the build was successful.2) and edit echo Hello Word, and save the launch
Shell wildcard characters# notice is completely different from regular, similar to regular * any of at least one character ? Any one character [ ] [] any one of the characters, the relevant character set a-Z 0-9Shell redirection# re-designation of
What is a scrapy shell?The Scrapy terminal is an interactive terminal that allows us to try and debug the code without starting the spider, or to test XPath or CSS expressions to see how they work and to easily crawl the data in the page.Selector
1. Determine the type of all files in the/var/directoryfor files in /var/* ;do if [[ -f $files ]];then echo "$files exists and is a regular file." elif [[ -h $files ]] ;then echo "$files is a symbolic link." elif [[ -d
1. Two methods of setting login prompt(1)/ETC/MOTD[[email protected] thzzc]# echo this is THZZC test Linux >/ETC/MOTD[Email protected] thzzc]# CAT/ETC/MOTDThis is THZZC test Linux(2)/ETC/PROFILE.D[Email protected] home]# echo echo This is THZZC
Learning Environment: Ubuntu How to view the system version: [# Cat/proc/version]1. For loop Practice 1.1 batch generate random character file name caseExperimental purpose: Generate 10 randomly generated txt text under the/learning path, and the
1. Position variableScript:[Email protected] sh]# cat/opt/sh/test1.sh#/bin/bashecho "The script name and path you executed are:" $The first parameter of the echo "script is:" $The second parameter of the echo "script is:"The third parameter of the
11.1 Declare: Show or set shell variables
11.2 Export: Display or set environment variables
11.3 Set: Display and set shell variables
11.4 unset: Deleting a variable or function
11.5 env: Viewing and setting environment variables
Array:Variables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray name and IndexIndex: Numbering starting from 0, which is a numeric
ArrayAn array is an ordered sequence of elements. If a collection of variables of the same type is named, the name is an array name. Each variable that makes up an array is called the component of an array, also known as an element of an array,
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