In shell scripts, all of our variables are stored as strings. So it becomes very important for the interception of strings.In a shell script, if you want to specify a string for interception, there are several ways to do it:The following examples
1. Remove the left character and leave the right character1). Use # InterceptExample: str= "http://www.baidu.com"650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/82/DC/wKioL1djQu_CLXeEAAAzIuXnc10469.png-wh_500x0-wm_3
#函数: Must be defined before using#格式:#function_name () {# List of commands# [return value] #可以显示增加return语句, if not added, the last command runs the result as a return ##返回值只能是整数, generally used for function execution success or not, 0 for success,
Overview What is a shell?The shell acts as an interface between the user and the Linux system, allowing the user to enter commands that need to be executed to the operating system. This is much like the command prompt for Windows, but the strong is
Shell IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the command entered by the user and feeds it into the kernel to execute.Running backgroundA basic Linux
The actual combat target for the log desensitization, the log directory of all the files processed, all involved in the card number and password information, will be replaced by "*" number, to replace the contents are obtained from the corresponding
1. Regular and wildcard characters
The wildcard characters in Linux are used to match the file names, and their matches are exact matches. Only wildcard characters are supported, command has LS find CP and other commandsThe regular is used to match
a.expr normal addition multiplication operation Note: Expr can only perform integer operationsExpr 2 + 2Expr 2-2Expr 2 \* 2Expr 2/2Attention:1. Operators and calculated numbers have at least one space around them2. Using multiplication sign, you
Commonly used arithmetic operators, assuming that variable A is 10 and variable B is 20:Operator Description Example+ addition ' expr $a + $b ' result is 30.- subtraction ' expr $a-$b ' result is 10.* multiply ' expr $a \* $b ' result is 200.
1. Read reading variables from the keyboard 2. Declare/typeset declaring variable typesA. The-i option of the DECLARE command specifies that the variable is an integer type (the default is a string) B. The-X option of the DECLARE command specifies
When a user logs on to a Linux system, the login shell executes the required script in the following order.First, execute/etc/profile this startup script, in/etc/profile This startup scripts will call all the startup scripts in the/ETC/PROFILE.D
Shell: A weakly typed programming language
What is a weak type and what is a strong type?
Strongly typed: Variables must be declared beforehand and even initialized before they are used;
Weak type: variable time
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/80/20/wKiom1c4dD-wFZx7AAAbgLBZiMU936.jpg "title=" Wkiol1cwdpjb1fbhaaabfqyv8vs885.jpg "alt=" Wkiom1c4dd-wfzx7aaabglbzimu936.jpg "/>
First, the great cycle of the For loop
Shell annotations1. Single-line CommentLines that begin with "#" are comments, which are ignored by the interpreter.debian:/# Vim first.sh#!/bin/sh#This is my first shell (this line is a comment)echo "Hello World"2. Multi-line annotationsThere are
First question: Recursion and non-recursion of Fibonacci sequencesNon-recursive:650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/82/EF/wKiom1dl-8rD92igAAB-pImrC88891.png-wh_500x0-wm_3 -wmp_4-s_582408408.png "title=" series non-recursive
1. DefinitionThe Hill sort (Shell sort) is a sort of insertion. Because of D. L The shell was named after it was introduced in 1959.2. Basic IdeasFirst, take an integer less than n D1 as the first increment, dividing all the records of the file into
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.