Shell script, insert "|" between every 5 characters, do not insert "|" At the end of the line.

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

Shell script to handle Nginx site logs

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

Case and function of shell programming

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

Conditional testing of Shell programming

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,

Shell Programming Learning 2--Command Daquan

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

Linux Shell script Programming--cut command

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

Execute one shell script per second)

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

Shell shortcut keys

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

Special symbols in the shell

;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

Linux Learning Diary-shell script Basics

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

Installing the virtual machine shell script

Installing the virtual machine shell script650) this.width=650; "title=" screenshot from 2016-10-19 13_18_47.png "style=" Float:none; "src=" http://s4.51cto.com/

Awk's shell quickly modifies file names

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

Parameter references in the shell

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

A few common 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

Python3-file's modification implements functions like sed in the shell

# 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

Java invokes shell commands and scripts dedicated to Hadoop/spark clusters

ObjectiveNote that this blog post is based on the following blog posts, based on them, dedicated to my big data

Java Shell Sort

schematic diagram:Package SUANFA; Public classShellinsert { Public voidShellInsert1 (Double[] Sorted,intInc) { intSorted_length=sorted.length; for(inti=inc+1; i){ if(sorted[i]Inc]) {sorted[0]=Sorted[i];

Python3.5 Day3 Job One: Implement a simple shell sed replacement function

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.

Shell array (produces different random numbers)

#!/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}

1. Initial knowledge of the Shell scripting language

  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

Total Pages: 541 1 .... 536 537 538 539 540 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.