Shell Scripting Basics (bottom)

Case judgment in the shellFormat: Case variable name invalue1)Command;;value2)Command;;*)Commond;;EsacIn a case program, you can use a |, meaning, or means in a condition, such as:2|3)Command;;When the variable is 2 or 3 o'clock, the part of the

Linux Shell Test keyword

1) Judgment expressionIfTest (expression is true)IfTest! expression is FalseTest expression 1–a expression 22 expressions are trueTest expression 1–o Expression 22 expressions have a true2) Judging the stringTest–n string string is not zero in

Shell creation functions and reference functions

Typically, when you write a shell script, you'll find that the same piece of code is used in multiple places. It doesn't matter if it's just a small piece of code. But it's hard to rewrite chunks of code multiple times in a shell script. The bash

Getting Started with Shell awk

This document is referenced from http://www.cnblogs.com/zhuyp1015/archive/2012/07/11/2586985.htmlAWK: useful Data processing toolsAwk is also a great data-processing tool! SED is often used for the processing of an entire row, and awk prefers to

The regular expression of shell programming

Regular expressions are primarily a grammar rule used to describe character permutations and matching patterns. It is mainly used for the pattern segmentation, matching, finding and substitution of strings, the main purpose is to match.Wildcard

WDCP Environment Build shell script analysis--install.sh

#!/bin/bash### #定义screen的名字, the following installation will use screen this command screen_name= "LANMP" #根据 $UID to determine whether the user is root, must root to perform if [  $UID  != 0 ]; then    echo  "You must be root to

Makefile shell script; sed command

1. To use the shell script in makefile, you need to add the "@" symbol, for example:@if [-D xxx]; Then \//-d to determine the existence, in the shell, with the [] number instead of parenthesesRM-RF xxx; \Fi@cp-FV xxx xxxx//-f Delete the existing

Shell script Programming

1. Write the shell script, calculate 1-100 's and;#!/bin/bashsum=0;for((i=0;i100$sum$i ))}echo$sum2) Write the shell script, ask to enter a number, and then calculate from 1 to the input number and, if the input number is less than 1, then re-enter

Shell Text Word Count

The contents of the Words.txt are as follows:The day is sunny the the the the and the Sunny isCount the occurrences of each word and output in descending order.The Unix pipes script is as follows:Cat TR ' ' ' \ n ' Sort Uniq Sort awk ' {print $, $

Linux shell directives such as-D,-F,-E, and other judgment expressions

Source:http://zhidao.baidu.com/question/322131711.htmlFile comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file

Shell creates hive table partition periodically

First look at the help command for hive:[[email protected] hive]$ hive-hmissing argument for option:husage:hive-d,--define Va Riable subsitution to the Apply to hive commands. e.g.-D a=b or--define a=b--database Specify the database to Use-e SQL

Shell Script-1

.: Denotes any character*: Matches the previous character, A * indicates: 0 or more A+: Matches the preceding character to represent 1 or more preceding characters?: matches the preceding character to represent 0 or more preceding characters#!

Shell script obtains native IP address

Tag: IP address #!/bin/bash#author: #date: 2015-6-13#filename:ip.sh############################ #ifconfig_cmd = ' which  Ifconfig ' $ifconfig _cmd > ifconfig.me################################## #function  obtain_ip_ Information () { if grep -q  '

A shell script that automatically restarts after the monitoring process hangs on Linux

This article describes the shell script, through a while-do loop, with Ps-ef|grep check whether the loader process is running, if not run, then start to ensure that the crash hangs the process, and automatically restart in a timely manner. The

Special usage of $0,$?,$! in shell

$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the Case of "" ", in the

IFS usage in the shell

I. Introduction of IFSthe Shell script has a variable called IFS (Internal field seprator), the internal domain delimiter. The full definition is the shell uses the value stored in IFS, which are the space, tab, and newline characters by default, to

Realization of clustering algorithm by Spark-shell

Spark version 1.3.1Scala version 2.11.6Reference official website http://spark.apache.org/docs/latest/mllib-clustering.htmlAfter running Spark-shell, first import the required modulesImport Org.apache.spark.mllib.clustering.KMeansImport

Shell script [Operational expressions, conditional control statements], shell expressions

Shell script [Operational expressions, conditional control statements], shell expressions #! /Bin/bash # The four expressions you deserve to add to your favorites. Val1 = 1val2 = 1val3 = 1val4 = 1val5 = 1val6 = 1val7 = 1let val1 ++ (val2 ++) val3 =

Linux Shell variables and linuxshell Variables

Linux Shell variables and linuxshell Variables M @ meng :~ $ B = 2 + 3 m @ meng :~ $ Echo $ b2 + 3 However, the declare command can be used to set the type of a variable. Currently, only integer and array types are supported. Now, consider

SHELL script-1, shell-1

SHELL script-1, shell-1 .: Represents any character *: Matches the preceding character. a * Indicates zero or multiple. +: Match with the previous character to indicate one or more previous characters. ? : Matches with the previous character to

Total Pages: 541 1 .... 473 474 475 476 477 .... 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.