Shell Programming Basics (ii)

Shift parameter moves left oneSHIFT + number, the parameter moves to the left n bits at a timeIt can be used to determine the number of parameters behind the program.Returns an error when the shift value is emptyUse read to assign input values to

Implementation of dependency processing and parallel compilation of Docker image under shell

Implementation of dependency processing and parallel compilation of Docker image under shellRecently, when making a series of Docker image compilation scripts, I thought we could not speed up the parallel compilation, checked the data, and finally

Examples of ${}, #, # #,%, percent of% in the shell

DescriptionI believe that in the work, many friends in the use of shell scripts encountered ${},%, #等这些字符的使用, and occasionally they will be dizzy, and then I use the following example to let everyone very well remember the Shell ${}, # #和 percent

Application of shell script learning advanced and regular expression

Sort order:-F: ignore character case-N: Compare numeric Size-T: specify delimiter -K: Specify to compare field ordinals after delimited-u: duplicate rows, only once Sort by the second row of values:$ sort-k2n SORT.TXTCCC 8aaa 11yyy 12

Introduction to the Shell Basics of Linux (2)

8.6 Pipe break and job control:1, cat 1.txt |wc-l; Cat 1.txt |grep ' aaa '2. Ctrl Z pauses a task3. Jobs View background tasks4, Bg[id] The task to the backstage5. Fg[id] Transfer the task to the front desk6. Add & Drop the command back to the

A script that takes you through the Shell basics

For example, the need to test a batch of IP in the work is still blocked, you need to write a simple script ping test.We need two machines,Virtual Host: centos6.7 systemLocal linux:centos6.5"Virtual Host"Remote to the host, add IP (Learn the script,

A shell script generates a serial number for the client using the server

#!/bin/Bashinterface=`ls/sys/class/net|grepen|awk 'Nr==1{print}'`if[!-e/etc/adserver/.seq.Info]; Then#生成序列号 #时间 #d=`Date+%y%m%d 'mkdir/etc/adserver/D= ' Dmidecode-t0|grep-op'(? '|awk-F':' 'nr==1'|awk-F'/' '{print $3$1$2}'' #批次lot=' on'#mac地址 mac= '

The Linux Shell "(())" Double parenthesis operator uses the

The Linux Shell "(())" Double parenthesis operator uses theAt the beginning of learning Inux shell scripting, for its arithmetic and logical operations. It is estimated that many friends feel more difficult to accept. When using the special variable

Linux Shell instances

UI Items Delete useless strings in the "UIL" file:The script needs to develop a TXT file for the UIL file directory location & useless string, such as deleting a useless string from the Haier directory:./delete_uil_string.sh.

Linux Shell string interception and splicing

A string interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.linuxidc.com/123.htm 1 # Intercept, delete the left character, and leave the right character.  Echo ${var#*//}where Var is the variable name

Zephyr's Shell

1 PrefaceThe shell can deal with subsystems, and subsystems can provide many interfaces for external settings and read information.Below is the kconfig configuration of the shell, the use of the shell, and how to create a new shell command.It can be

Shell finishing (38) = = = Caesar encryption and decryption

The implementation is as shown in the following:[Email protected] shell]# bash zong.sh================== Caesar encryption and decryption ==============================1) input string for Caesar encryption (the input string can only be letters,

Linux shell under 16 binary "\uxxxx" Unicode to UTF-8 Chinese

The issue occurs in the background:There is a project through the IP to get the city needs of attribution, I was directly through the IP Attribution query interface of Sina to obtain. I'm using a shell script callresult=$ (curl-s '

Shell finishing (29) = = = Determines whether the user input can be used as a variable

(a) Title:Accept a user input to determine if the input can be used as a variableConditions that can be used as variables(1) Uppercase and lowercase letters can be(2) A number may be in the middle of the letter, but cannot begin with a number(3)

Usage of SEQ in shell echo-n usage

Usage: seq [options] ... TailOr: seq [options] ... First Count MantissaOr: seq [options] ... First number increment MantissaTwo ways to cycle from 1 to 100 (bash other shells have not tried)For x in ' seq 1 ';d o echo $x;d oneFor x in {1..100};d o

Linux Shell Programming---Calculate the first 10 large files in a specific directory

calculate the front of a specific directory Ten a large fileIn a given directory, want to know which large files exist, take the top 10, by file size ranking(1) , using awk to achieve#!/bin/bashPath=/root/shellFind $path-type F | awk ' {Var=$0"Ls-l"

The role of various parentheses in the shell (), (()), [], [[]], {}

One, parenthesis, parentheses ()1, single parenthesis ()① Command group . The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in

Shell script to get basic information about Linux server

Test Run Environment: SLES12SP2#!/bin/bash#系统名称;os_type=$ (Uname-o | awk ' {print ' | ' +} ')#系统位数; 32/64os_bit=$ (uname-m | awk ' {print ' | ' +} ')#内核发型版本kernal_version=$ (uname-r | awk ' {print ' | ' +} ')#系统版本信息sys_info=$ (cat/etc/issue | awk ' {

Shell Getopts Learning

#!/bin/bashwhile getopts I:VH Namedo case $name in i) Opt=1 echo $OPTARG;; V) opt=2 Echo 2;; h) opt=3 echo 3;; *) echo "Invalid arg-$OPTARG";; EsacdoneThe getopts is used in the following form:

Shell and VI Editor

1.1 What is a shell? in computer science, Shell commonly known as Shell , used to distinguish from Kernel ( nucleus ), refers to the "User interface " software ( command parser ). It is similar to DOS command and later cmd.exe. It receives the

Total Pages: 541 1 .... 181 182 183 184 185 .... 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.