TextAaaaabbbbbcccccddddeeeeefffffkkkkkvvvvnnnnngggggThe following results are expected:aaaaa|bbbbb|ccccc| ddddeeeee|fffff|kkkkk| VVVVNNNNN|GGGGGMatch requirements: You want to insert a "|" between every 5 characters, and if the number of characters
In the Nginx site, access and error are using the default log format, with the log file named as follows:Www.xxxx.com.access.logWww.xxxx.com.error.logThe script processes the previous day's log records, re-places the logs in compressed files, and
I. Overview of CASE statementsUse case statements to rewrite if multiple branches to make the script structure clearer and more hierarchicalPerform different command sequences for different values of variablesThe case statement is structured as
Condition test(a) Concept: to determine the specific conditions to determine how to perform the operation, when the condition is set, the return value of the test statement is 0, otherwise, the other value, meaning if the echo $? The value is 0,
There are a number of commands in Linux that can be divided into 10 categories (see [1]): 1) file management; 2) document editing; 3) file transfer; 4) Disk Management; 5) disk maintenance; 6) network communication; 7) system management; 8) system
CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimited character '-f fields options with Parameters: -D: followed by delimited characters. Use with-F; -F: Divides a piece of
Linux a simple Execute command shell script per second 2012-08-06 11:47:06Category: Python/rubyA server was migrated last week, the data of one of the items is not updated, the data of the original server is queried, the data is updated, the Rsync
Ctrl + A cursor moves to the beginning of the lineCtrl + E cursor moves to end of lineCtrl + R Search in the history commandCtrl + L Clear ScreenCtrl + U Clear the cursor to the beginning of the characterCtrl + K Clears the character of the cursor
;Semicolon, which is used to split multiple commands, each command executes sequentially, but there is no logical relationship between multiple commands, only sequentially (that is, even if the previous command execution fails, it does not affect
In the daily maintenance of Linux, Shell script is one of the essential daily management, its role is to solve the automatic maintenance of the server, reduce the workload of the Administrator, if you want to improve the speed of writing shell
Scenario: Fake tune There are several files like this in your directory1.jpg?v=12.jpg?v=23.jpg?v=34.jpg?v=4What if the v=x of the file is removed?Method One: Direct write command implementation using AWK shell command implementationls | awk ' {split
Reference parameters
Describe
0,1,2.
Positional parameters. Start with the parameter 0. The parameter 0 references the name of the Startup bash program, and if the function runs in the shell script, the name of the shell
As mentioned above, the shell is a scripting language, so there must be an interpreter to execute the scripts.The common shell scripting interpreters on Unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell. We often
# Auther:aaron Fan‘‘‘Ideas:The purpose is to modify yesterday this file, but because it is not possible to directly modify the file, so the modified content needs to be written to the high yesterday.new this file,And then overwrite the contents of
Demand:1. Enable Python to have the SED replace function in shell.#!/usr/bin/env python#_*_conding:utf-8_*_#the SYS module is used to pass parameters, and OS modules are used to interact with the system.ImportSys,osold_file= Sys.argv[1]new_file= Sys.
#!/bin/bash#declare-a arrayread-p "Please input num[1-39]:" emenum# compare whether the newly generated random number repeats function Comele {for J in ' seq 1 ${ #ARRAY [@]} ';d o if [$1-eq ${array[$J]}]; then return 1 fi-Done return 0}
PS: In the Linux system-based STM8 firmware upgrade project, you need to let the CPU through the I²C bus to STM8 transfer data, just start one of the knock, a waste of time, and then consider the shell script, although the shell script is very
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