declaring the execution program#!/bin/bashUsed to tell the system to use the/bin/bash program to execute the script. For example, a Python script can be written like this:#!/usr/bin/pythonassignments and referencesAssignment formula:Variable name =
During this period of time, I was engaged in big data research. Where should I find a large amount of data? Well, some automatic generation tools on the Internet do not meet my own needs, so I wrote one myself, A script that can generate a large
To make it easier for you to review your memory, we will summarize the hadoop commands of today's experiment for later viewing. Note: The following commands are performed in hadoop/bin. 1. hadoop FS-ls \-> View All the following directories. 2.
Hadoop FSList all commandsHadoop FS-help lsList detailed information about a commandHadoop DFS-mkdir/data/weblogsHadoop DFS-mkdir/data/dir1/data/dir2...Create a folder that can be recursively created and multiple directories can be created at the
Exec also allows the script to be executed in the same process, but the original process is ended.
Script content:
Root @ James-desktop:/opt/Qt-everywhere/Marvell/APP/applications/factory-Roast # Cat 1.sh#! /Bin/shA = BEcho "PID for 1.sh:
1. shell scripts and function scripts are files that contain shell commands. They are a shell program and run in three ways: one is to type source scriptname to read and run the script commands, just like typing them. Second, run bash scriptname and
1. For Loop statementsBasic for loop of instance 1.1
#! /Bin/bash
For X in one two three fourDoEcho number $ xDone
Note: A "for" loop always receives a certain type of word list after the "in" statement. In this example, four English words are
While test conditions
Do
Statement 1
Statement 2
Done
Test condition: if the condition is met, the loop is closed until the condition is not met.
How does a while loop exit? Change the variable value corresponding to the test condition in the loop
1. Variable type in Shell
Shell variables can be divided into environment variables, location variables, pre-defined special variables, User-Defined variables,
Environment variables in shell are shell predefined variables used to set the system
When testing hadoop, The dfshealth. jsp Management page on the namenode shows that during the running of datanode, the last contact parameter often exceeds 3. LC (last contact) indicates how many seconds the datanode has not sent a heartbeat packet
Shell script Learning (2): conditional statements and loop statements 1. conditional statements
First, when it comes to conditional statements, we have to first talk about the judgment of the conditional expressions. What types of conditional
In the past few days, when writing Android. mk, sometimes I always want to print some variables or something. If ECHO is not available, I can find a way to access the Internet.
Finally, I found such an article quite well.
Address:
If statement test condition. After the test condition returns true (0) or false (1), you can execute a series of statements accordingly. If statement structure is very useful for error checks. The format is:If condition 1Then command 1Elif condition
! $! $ Is a special environment variable, which represents the last string of the previous command. For example, you may:
$ Mkdir mydir $ MV mydir yourdir $ CD yourdir can be changed to: $ mkdir mydir $ MV! $ Yourdir $ CD! $
Available directly! $
1. CTRL + A returns the character at the front of the edge.
2. When Ctrl + R is used to query history, the command used is prompted.
3. In VI, move to the row header, press the number 0, and move to the end of the row and press $!
4. You can
One idea is to use awk to first create a conversion table between characters and ascii codes or numbers in the awin of awk, and then read the character table to be converted to output the corresponding conversion code. The following sample code
1. display all Android platforms in the system:
Android list targets
2. Display All AVD (simulators) in the system ):
Android list avd
3. Create an AVD (simulator ):
Android create avd -- name -- target Platform ID
4. Start the
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