Keywords in the shell intercept file

1.Linux Shell intercepts the first 8 bits of a character variableThere are several ways to implement this: Expr substr "$a" 1 8 echo $a |awk ' {print substr (, 1,8)} ' Echo $a |cut-c1-8 echo $ Expr $a: ' \ (. \ \). echo $

Hbase Shell Data Operating instructions

Start, close HBase./bin/start-hbase.sh./bin/stop-hbase.shQuery the HBase version. Its syntax is as follows:HBase (main):010:0> versionBuild tableCreate ' ', ' 'Create ' emp ', ' personal data ', ' professional data 'List all tables: ListTable

Get started with simple shell scripting

One, Shell scriptScript: Can execute the file, after running can implement some function (command stack, non-interactive)Standardize the general composition of shell scripts#! Environmental Statement (Sha-bang)# comment TextExecutable codeSecond,

Shell Basic Syntax

1 Specifications for Shell scripts:1 file suffix is. sh2 first line is the command interpreter: #!/bin/bash3 The first line below the comment write script basic information:Script name, function, writing time, author, contact, etc.2 Shell Execution

Shell Exercises-judging functions

Use the conditional function if to compose a shell function called F_judge, which implements the following functions1) when the/home/log directory exists, move the files or directories that start with all TMP in the/home directory to the/home/log

Linux--Shell programming

Linux--Shell programming one, regular expression 1, regular expression PK wildcard        2.Basic Regular Expressions1),*The previous character matches 0 or more times~ grep "A *" Test_rule.txt # matches all content, including blank lines~ grep "aa*"

2.5-shell Programming Preliminary

Previously review:File management, user management, rights Management, Bash's basic featuresFile Management: CP,MV,RMUser

Qualified Linux OPS personnel must be 30 shell programming surface questions and explanations-08

Enterprise Actual combat Problem 8: How to implement the MySQL database for sub-library backup, please use the script to implementMy script

Shell finishing (31) = = = To determine if the input is IP

(title): Determine if the incoming parameter is IPIdea: 192.168.1.1is the condition of the IP, * * * dot decimal This four number must be less than 255Dot decimal must be guaranteed to be a number, not a letter#!/bin/bash[ -z $1 ] && echo  "uesage : 

Shell Script Learning Notes

1./dev/null/dev/zero ①/dev/null:/dev/null, called an empty device, is a special device file that discards everything written to it (but reports a successful write operation) and reads it immediately to get an EOF. In Unix jargon,/dev/null is called

If Judgment statement in Shell

If condition test Type: File test, digital test, string testIf statement structure: If ...; Then ...; Fi If ...; Then ...; else ...; Fi Conditional test expression: [Expression]

Common shell commands

1. Find the contents of the file (e.g. account number: zh123456): Grep;lsMode 1 Find all Files: grep zh123456 *Mode 2 recursive lookup: ls | Xargs grep zh123456Mode 3 Recursive lookup: Find. -name ' apf44_zswmpay* ' |xargs grep applog|awk-f ": '

Shell Programming-project Deployment (optimization)

In the actual work of small and medium-sized to encounter a problem that is when I go to operate the deployment script, another person can also operate, this how can do, and then the small part of the thought to re-optimize the code, add a process

Introduction to Shell Process statement usage

1) Use if, case, readExample 1:#!/bin/bash#读取终端输入的字符Read-p "Please input a number:" NN1= ' echo $n |sed ' s/[0-9]//g '#使用if语句进行判断if [!-Z $n 1]Thenecho "Please input a number."Exit 1elif [$n-lt 0] | | [$n-GT 100]Thenecho "The number Ranger is

The shell script will specify the directory of the first 3 days of the date after the directory is packaged with tar and deleted from the source date directory

#/bin/bashWork_home=/dataOlddata_home= "${work_home}/olddata"Target_day= ' date-d '-3 day "+%f"#打包前3天的日期目录压缩成功后并删除TAR-ZCVF ${olddata_home}/$target _day.tar.gz ${olddata_home}/$target _dayIf [$?-eq 0];thenecho "The $i is Compression success"RM-RF

Linux commands (10)--shell programming one (variables and operators)

The shell is an interface between the user and the system in a Linux system, and it is a high-level programming language, in addition to being the command interpreter. In the Linux command described earlier, the shell appears as a command

Shell Transfer Array Parameters!

Knowledge Points: Array function Local Variables Defining pass-through parameters Example 1:A= (1 2 3) b= (a B c) function () {Local a=$1 local b=$2 for I in $a does echo $i done Ech o $b}funcition "${a[*]}" "${b[*]}" Result: 12

"Arrays" in the shell

Defining arraysArray name = (value 1 value 2 ...) Value N)[Email protected] ~]# array_name= (value1 value2 value3 value4)Reading an array${array name [subscript]}[Email protected] ~]# Echo"${array_name}"Value1[[email protected]-r3-srv ~]#

Shell multithreading operations and number of threads

Task required: When I need to compress the files in a folder separately:The original code:1 #!/usr/bin/shell2 function Getdir () {3 forElementinch' LS $`4 Do5 #Echo $element6Dir_or_file=$1$element7 8 #Echo $dir _or_file9

Linux shell array creation and usage tips

Reference URL: http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.htmlThe Linux shell is much more powerful in programming than Windows batch processing, and cannot be compared in terms of loops, operations, and data types. Here is a summary

Total Pages: 541 1 .... 407 408 409 410 411 .... 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.