String interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.Echo ${var#*//}where Var is the variable name and the # is
Shell script variable What is a variableReplace another complex or volatile data with a simple "word"Display and setting of variables: The display of Echo,unset variables Echo ${path}Setting rules for variablesequal sign Connection variable =
A test condition to judgeReturns a 0 exit state if the expression is true, or a non-0 exit state if the expression is false. Test has an alternative syntax, which is easier to read by enclosing the expression with parentheses "[]".1. string
some things to note about shell script:1, #这个符号是注释本行, usually used for annotations, #! Except that it is used to label which Shell executes this script,2, the order of execution from top to bottom, from the right3, ignoring blank lines, tab spaces4,
Meaning: Split the file by column according to the delimiterSyntax format: cut [options] ... [File] ...-C, --characters by character-F,--fields by column-D,--delimiter specifies delimiter, default is tab (\ t)Example: viewing file contents Cat
---------Transferred from http://www.runoob.com/linux/linux-shell-array.html----------Copyright belongs to the original! Shell some powerful commandsShare some shell usages and scripts that you may not know about, simple & powerful!Before reading
OneHttp://www.cnblogs.com/GarveyCalvin/p/4301235.htmlTwoForeword: Zsh can be configured strong, user can customize the configuration, personalization is strong. Zsh Tab Completion is more powerful, this feature allows us to save a lot of time. Zsh
Before you learn the regular expression, be clear and keep it in mind:In Linux, wildcards are interpreted by the shell, while regular expressions are interpreted by commands, so don't confuse them. Remember!!!usually have three text Processing tools/
Test command, Loop statementTest command format:Test conditionUsually, in the If-then-else statement, [] instead, that is, [condition]. Note that there are spaces on both sides of the square brackets.Common commands:-a two conditions at the same
Recently wrote a small program, need to use time. Traverse as part of a folder#!/bin/bashfor i in {1..30}dodate= ' date +%y/%m/%d-d "$i days Ago" ' Echo $datedoneFor loop, take the date of the recent n days.The core isDate= ' Date +%y/%m/%d-d ' $i
One: Shell introduction1. What is a shellThe Shell's Chinese meaning is "shell," in layman's words, the shell is an interactive programming interface that uses the user input to drive the operating system kernel to complete the specified work. In
Bo main name: Li ChangmingPost Address: http://keep88.blog.51cto.comThis note is from the old boy books: Learn Linux OPS Shell programming with old boysThe advanced and practice of shell variable knowledge1. Special positional parameter variables in
shell script : hello.sh#!/bin/bashecho"I am in shell script"echo"param 1 is'echo'param 2is $"variable=$[$1 + $2 ]echo"sum is $variable"System Interface : SYSTEM.C#include void main (void) { printf ("I am in C code!\r\n" System ("/bin/bash"). /
Here is a record of how the shell script can be color-output, using a bit in Python also applies.echo Display in shell script with color display, echo display with color, need to use parameter-EThe format is as follows:Echo-e "\033[word background
Vi/etc/logrotate.d/nginx #编辑脚本/usr/local/nginx/logs/*.log/usr/local/nginx/logs/nginx_logs/*.log{Missingok # ignores errors, such as "log file cannot be found" error message. Dateext # The log file after the switch is appended with the date of the
Issue One: dos differs from windows in cmd On Windows systems, start-run-cmd can open "cmd.exe" for command-line operations. The operating system can be divided into the core (kernel) and shell (shell) two parts, wherein the shell is the operating
Ifs:A direct description of the usefulness of IFS, details of what ifs is doing ... Self GoogleFirst create a file of "a", and "a":Then we look at LS:--LSA a AIs this.Then if we need to write a script to manipulate each file:--For I in $ (LS); Do
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