First, take an integer d1 less than n as the first increment, dividing the entire record of the file into D1 groups. All records that are multiples of the DL are placed in the same group. A direct insertion sort is performed within each group, and
Instance: Generate temporary file record Apache process number, kill Apache process, Delete temp file 1#!/bin/Bash2#create_log. Sh3 4#1. Get the process number to all httpd applications5#2. Deposit the process number in a temporary
Shell programming: For Hadoop programmers, it is often necessary to familiarize yourself with shell programming, because the shell can easily run program code.1. Shell file format: xxx.sh#!/bin/sh---The first line of the shell file must be written
Take a look at the logic operations in bash before you learn the basics of Shell programmingBash features multi-command executionCommand;command1 ... Sequential execution structureSelect the execution structure:Logical operation:VS: Logical
Under the Linux system, Shell scripts can help us in a variety of situations, such as displaying information, even automating specific system administration tasks, creating simple command-line tools, and so on.In this guide, we'll show Linux novices
Design a shell program, add a new group to Class1, and then add 30 users belonging to this group, the user name in the form of Stdxx, where xx from 01 to 30!#/bin/bashgroupadd class1 for i in {1..30}do if [ $I
The data flow redirection is used when adding logs to memcached, so I intend to summarize it.
Command
Description
Command > File
Redirects the output to file.
Command
Redirects the input
3.1 Regular Expression BasicsThe primary function of regular expressions is text query and string manipulation. is actually string filtering.Regular expressions include ordinary characters and metacharacters character, meta-character main, see the
Specify bashShell script first line, #! What should it be?Most of the cases/usr/bin/env bash,/bin/bash,/usr/bin/bash,/bin/sh,/usr/bin/env sh are equivalent, but few cases still have pits. If the default shell may not be bash, such as a release law,
The shell can be said to be an interpreter while providing a running environment for the code to run. and provides the programming capabilityThe shell does not have its own library, it just writes the applet commands within the command invocation
0. Standard format for professional scriptingFunction 1 function 2main function main $*1. Use the Dos2unix command to convert scripts developed under WindowsDos2unix is not installed by default and can be installed in Yum# Dos2unix web_jk.shdos2unix:
The && operator syntax is formatted as follows: Command1 && command2 [&& Command3 ...] 1. Use && connection between commands to implement logic and functions. 2. Only the command on the left of && returns True (command return value $?). = = 0) The
~ Home Catalogue ls ~"Inside the inverted quote is the command echo ' ls ' | ' Echo ls ' | echo ' echo ls ' | ' echo ' echo ls ' replace command $ ()! Take sung with the historical Command (!123) 123 is the history display#代表注视信息$ take Variable
Take a look at several common sorting algorithms in the next two days.1. Bubble Sort MethodEach time the adjacent elements are compared from i=0, if arr[i]>arr[i+1], they are exchanged. Until the biggest element is pushed to the end. Go back to i=0
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