Shell scripting Exercises (12.11)

For an even number of 100 or lessIdea: 1. Define a variable x firstThe range of 2.x is 0-50,x with an initial value of 13. And the value initial value is 0, each time the loop and the value is equal to itself +2*iMethod One:Vim

Shell and regular expressions

Shell expressionWhether the-D file exists and is a directoryThe-f file is present and is a normal fileWhether the-W file file exists and is writable-s file exists and is not empty-N string string length not 0String1=string2 string Equality-eq equals-

The shell that the Linux system automatically backs up

The company now needs to make regular backups of the existing servers and place the backup files in the NAS being used;For the efficiency of backup, we also need to filter the backup files and exclude some files with suffix names.The implementation

Linux Shell Basics

Shell is the core program kernel outside the instruction parser, is a program, colleague is a command language and programming language--shell is a command parser, the user Input command, it to parse.Shell type ash,bash,ksh,csh,tcsh--cat

Shell Basics Using Notes

Create 10 user user1-user10;[Email protected] ~]# vim user.sh#!/bin/bash #注释为bashFor ((i=1;i#条件Do #动作Useradd user$i # Add user, $i as variable (i=i+1, always execute to iecho "User$i" | passwd--stdin user$i #打印出来, create user password consistent

Shell variable operation

1. Define variables: In order to avoid conflicts with environment variables, generally lowercase: such as pp= "mydql,kdkfeof";Second assignment scheme:The calling variable uses the $ symbol:Variable overlay:2. The output uses ECHO, as shown in:3.

Linux Shell Data redirection

The common input and output operators under the Linux shell are:1. Standard input (stdin): code 0, using 2. Standard output (STDOUT): Code 1, using > or >>/dev/stdout,/PROC/SELF/FD/1 1 for:/dev/stdout3. Standard error Output (STDERR): Code 2, using 2

Shell script commands

######################## # # #6. Shell script Command # # ######################### # # #1. diff####diff file File1 # # compare two different files 650) this.width=650; "Src="

Conditional testing of Shell programming

Condition test(a) Concept: to determine the specific conditions to determine how to perform the operation, when the condition is set, the return value of the test statement is 0, otherwise, the other value, meaning if the echo $? The value is 0,

Linux Shell script Programming--cut command

CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimited character '-f fields options with Parameters: -D: followed by delimited characters. Use with-F; -F: Divides a piece of

Shell shortcut keys

Ctrl + A cursor moves to the beginning of the lineCtrl + E cursor moves to end of lineCtrl + R Search in the history commandCtrl + L Clear ScreenCtrl + U Clear the cursor to the beginning of the characterCtrl + K Clears the character of the cursor

Special symbols in the shell

;Semicolon, which is used to split multiple commands, each command executes sequentially, but there is no logical relationship between multiple commands, only sequentially (that is, even if the previous command execution fails, it does not affect

HBase Shell Basic Command Summary

Accessing HBase, and manipulating hbase, commands do not use semicolonsHBase Shell enters HBaseList View TableHBase shell-dHBase (main):024:0> scan '. META. '============= Small Example ===================================================1. Create a

Input and output in the shell (Bash Shell 03)

Input and output in the shellStandard input: KeyboardStandard output: Terminal displayThe >> append is a newline appendEcho- n do not trailing line breaks-e enable escape function to interpret backslashes-e disables the escape function that

Chinese and English double quotes in the shell

When you replace characters in text with SED, you accidentally add a Chinese double quotation mark when the character is added, and when the result is replaced, you cannot always replace it.The file name is called A.txt and the text reads as follows:

How the shell reads each line of the file

1. Read a row of data using the Read commandWhile read Mylinedo echo "line:" $mylinedone 2. Read a row of data using the Read commandCat Datafile.txt | While read Mylinedo echo "line:" $mylinedone3. #读取一行数据Cat Datafile.txt | While myline=$ (line)

SWT Shell Setup window in the middle of the screen

/*** Setup window is located in the middle of screen* @param the Shell to adjust the position of the Window object*/public static void Center (shell shell){Get screen height and widthint screenh = Toolkit.getdefaulttoolkit (). Getscreensize ().

Condition testing and judgment in the shell

Condition test:To determine whether a demand is satisfied, it needs to be realized by testing mechanism;How to write a test expression to implement the required tests:(1) Execute the command, and use the command status return value to judge;$?:

Shell Problem Solving

If you want to find common commands, please click on the imageThe instructions in the shell script, in the uncertain case, do not arbitrarily use nohup, otherwise it may have disastrous consequences, such as-memory explosionShell random function

Java invokes shell commands and scripts dedicated to Hadoop/spark clusters

ObjectiveNote that this blog post is based on the following blog posts, based on them, dedicated to my big data

Total Pages: 541 1 .... 462 463 464 465 466 .... 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.