shell-Process State variables

$? is used to determine whether the previous command has performed successfully.If the return is 0, the execution succeeds and fails if it returns to a different value.650) this.width=650; "Src="

Shell programming (eight) text viewing and processing tools

Text viewing and processing tools: WC, cut, Sort, Uniq, diff, PatchWc:word CountWC [OPTION] ... [FILE] ...-l:lines-w:words-c:bytesCutCut OPTION ... [FILE] ...OPTION:-D CHAR: Delimiter with the specified character;-F Fields: the selected field;#: The

The most common shortcuts for Linux shell commands

Bash provides a number of shortcut keys, the following are the most commonly usedCTRL + A cursor moves to the beginningCtrl+e cursor moves to end of lineCtrl+l Clear ScreenCTRL + C terminating processCTRL + Z Hang up processCtrl+u Delete the

Shell script loop using for while explanation

Loops in any programming language are more than enough, and of course the shell script also has a looping statement, including a for statement, while statement. This article mainly uses the actual use case to illustrate what common use methods and

Shell determines whether a file or folder exists

#!/bin/sh mypath= "/var/log/httpd/" myfile= "/var/log/httpd/access.log" #这里的-x parameter Judging $ Whether the MyPath exists and has enforceable permissions if [!-X ' $myPath]; then mkdir "$myPath" fi #这里的-D parameter to determine if

Shell file Number Comparison

Echo ' 1.2*2 ' |BC++++++++++++++++ Digital ComparisonMode 1:Agm1=50Agm2=60If [3-eq 3-a ${agm1}-ne ${agm2}-a ${agm2}-gt ${agm1}-a ${agm1}-ge 50-a ${agm1}-lt ${agm2}-a ${AGM2}-le 60- o 4-GT 3]; ThenEcho ' Yes 'ElseEcho ' No 'FiMode 2:Agm1= ' ye 'Agm2=

Shell Basics-variables, judgments, loops

1. Shell basic format, variable# Add an interpreter to the shell script #! /bin/bash# Print out Hello world with a script#! /bin/bashecho "Hello World"ExitParameters: A parameter is an entity that stores real values that are typically referenced in

Shell script Bulk Modify file name

Before modifying the file name#!/bin/bask#for A in $ (ls/etc/yum.repos.d/centos*);d oif [$a! = '/etc/yum.repos.d/centos-media.repo '];then #CentO The S-media.repo file name does not modify the MV $a $a. bak

Shell Writing script Ideas

Shell Scripting Ideas: (Requirements analysis)1, lamp source One key integration=======================1) Install Apache, Mysql, PHP, lamp integration;------------------------Installing ApacheInstall MySQLInstall PHP-------------------------2) to

The most basic shell scripting

First, the basic writing process of the practice script:1. Determine the task and the command to complete the task2. Scripting Integration Tasks3. Authorization and test executionSecond, exercise:A. First I create a directory, put the script we

Shell's 99 multiplication table

echo-n non-newline output$echo-N "123" $echo "456" final output 123456 instead of 123456 echo-e handling special characters if the following character appears in the string, it is handled in particular, not as a general text output: \a a warning; \b

Shell launches Hadoop cluster

Original, reproduced please specify. Thank youShell launches Hadoop cluster1: Clear Boot order1) Start zookeeper cluster (in CentOS 4-02,centos6-02,centos7-02 respectively)app/zookeeper-3.4.5/bin/zkserver.sh Start//startup processapp/zookeeper-3.4.5/

Operation of variables in shell programming (Shell 06)

Mainly includes the following 3String manipulationMathematical operationsFloating point ArithmeticOne. String manipulationConnection of StringsConnection Word 2 strings do not need any connectors, write next to each otherLength acquisition  Expr

Shell command: SEQ

About SEQThe SEQ command is used to generate all integers from one number to anotherseq 1 5 Output 1-512345seq 5-1 1 Reverse Output 1-554321[[email protected] ~]# seq 1 2 //output 1-10 and output once every two digits 13579seq 9-2

Description of special variable $0,$?,$!,$*,$#,$1~ $n of shell species

Special variables:$?: The execution result of the previous command returns a value of 0-255,0 for execution success, and other values indicate unsuccessful execution$!:shell PID of the last running background processPID of the $$:shell itself$:

Shell for Loop

Similar to other programming languages, the shell supports A for loop.The general format for A for loop is:For variable in list do Command1 command2 ... CommandndoneA list is a sequence of values (numbers, strings, and so on), each

Shell while loop

The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is:While Commanddo Statement (s) to being executed if command is TruedoneThe command

Linux commands: Talking about how to perform arithmetic operations in the shell

1 , let arithmetic op-expressionLet c= $A + $BEg:a=3 b=5 let c= $A + $BEcho $C[Email protected] test]# a=3[Email protected] test]# b=3[[email protected] test]# let c= $A + $B[Email protected] test]# echo $C62 , $[arithmetic operation expression]c=$[$

Shell script Tracking and debug

Scripts are afraid of problems before they are executed. Linux provides no need to judge if there is a problem by directly executing the script.[Email protected]]# SH-NVX scripts.shParameters:-N Do not execute script, only check for syntax issues-V

Change the return value into an array variable under the shell

Under BASH2, you can use the ($ ()) combination to obtainVar= ($ (cat/etc/passwd |awk-f ': ' {print $} ' |head-3))Returns the full value of the array:Echo ${var[@]}OrEcho ${var[*]}To take an array of members:echo ${#var [@]}Orecho ${#var [*]}Take a

Total Pages: 541 1 .... 319 320 321 322 323 .... 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.