Shell Script Process Control

4.1.3 Shell Process Control Statements If condition judgment StatementIf ( expression ) #if (Variable in Array)Statement 1ElseStatement 2FiCase one, test if the directory exists, does not exist then new (note that space must be between the brackets)

Shell Script Process Control

4.1.3 Shell Process Control Statements If condition judgment StatementIf ( expression ) #if (Variable in Array)Statement 1ElseStatement 2FiCase one, test if the directory exists, does not exist then new (note that space must be between the brackets)

Shell gets the current path

Prg= "$"while do ls= ' ls-ld ' $PRG "' link= ' expr ' $ls": ' .*-> \ (. *\) $ ' ` if expr "$link": '/.* ' >/dev/null; then PRG= "$link" else C15/>PRG= ' dirname ' $PRG '/' $link ' fidoneprgdir= ' dirname ' $PRG '-Z ' $CATALINA _home "] &&

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/

Shell scripts for daily use

gpg

1, shell implementation without password loginhost=$1ssh-copy-ID"Password: " "123456\r"expect eofeof2. A node-categorized shell scriptnetwork="eth0"host1=`uname-N ' base=`uname-n|Cut-C1-3' Id1=`uname-n|Cut-C4-6`if((Ten# $id 12==1)); Then((Id2=Ten# $

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

Variable Description:$$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

Shell Command _awk command

# awk ' Condition 1{action 1} Condition 2{action 2} ... ' File namecondition (Pattern):Generally use relational expressions as conditions x > 10 to determine if a variable x is greater than 10x>=10 greater than or equal to xactions

I have encountered a summary of the shell trivia points

1) Use of shell ifDetermine if a.txt existsIf [-F a.txt]2) Execution result of the commandAssign the execution result of the command to the variable, the following two methods are the sametime=$ (date +%y%m) time= ' date + $Y%m '3) Find out what we

Shell Scripting Automated Collection

Remotely copy a file to the specified directory on the specified IP machine:./scp_file.sh/tmp/xx.sh/tmp/test/echo "Copy the file to the $ $ directory!"   "For IP in 192.168.60.243 192.168.60.244 192.168.60.245 192.168.60.246 192.168.60.248do scp-r" [

Shell Learning Questions

Write a script:1. Prompt user to enter a user name2, display a menu to the user. Shaped likeU|u Show UIDG|g Show GIDS|s Show SHELLQ|q quit3. Remind the user to select an option and display the Selection of contentIf the user gives an incorrect

Shell Script Raiders (learning note)--1.12 Read basics

To interact with Linux, the script gets keyboard input results that are essential, and read can read the keyboard input characters. 1. Restricting input characters For example, after you enter 5 characters, you end up with 5 characters entered into

Shell script, awk merging a column of issues.

The file file2 content is as follows:0 Qwert1 ASDFGHJK2 ASDJKL2 zxcvbn3 Dfghjkll4 222224 TYUIOP4 BNMMake the first column equal to one row, not the first column, that is, the following format:22222;tyuiop;bnmQwertAsdfghjkAsdjkl;zxcvbnDfghjkllThe

Shell Script Raiders (reading notes)--1.10 debug scripts

Using Sh-x or this bash-x, you can debug a script that outputs and outputs a state for each row while debugging, and It also shows the order in which the commands in the script are executed . You can also use set in the script to set the debug area.

Shell Primer to Mastery

Sort Http://www.cnblogs.com/51linux/archive/2012/05/23/2515299.html

Bulk modifying tables with shell scripts

Recently, because of the development of new features, the programmer needs to quickly add fields to all the tables in a library, so it is simple and quick to use shell scripts to add fields to the bulk modification table.#!/bin/bashexport mysql_bin=/

How the shell determines if the variable entered by the user from the keyboard is a number

There is no direct command in the bash shell to determine whether a variable is a pure number, then we are using an indirect method:Problem Description:Read-t 30-p "Please a number:" NUMUse the Read command to accept the user from the keyboard input

How do I view the shell built-in commands?

A type command is provided in the Linux command to see whether the system commands are built-in or external:650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/87/5C/wKiom1fePj-hZmqXAACtHTQFAN0922.png-wh_500x0-wm_3 -wmp_4-s_2639269358.png

99 multiplication table for shell scripts

A 9x9 multiplication table was written with a shell script, for reference only! Text below ...650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/53/wKiom1fc_6mT0-TPAABEz2kbGyk527.png "title=" 99.PNG "alt="

(vii) Shell programming learning

1. Shell program Exercise: Create a Dir folder and create a cd.c file in the Dir folderFirst VIM hello.sh2. Variable definitions and references in the shell(1) Definition and initialization of variables. A shell is a weakly typed language (a

Shell Script Raiders (learning notes)--1.7 array

There are two types of arrays in bash: normal arrays and associative arrays. An ordinary array can use integer values only as an array index, and associative arrays may use strings as indexes.1.7.1 Normal ArrayDefine an array in one way:[Email

Total Pages: 541 1 .... 327 328 329 330 331 .... 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.