Original:Http://blog.pureisle.net/archives/1352.html
The Shell provides a large number of basic operations that are useful in scripting. The Shell evaluates the arithmetic expression you provide, performs an operation expansion, and replaces an
The Java Execution Shell command has not been used before, and it is thought to be as convenient as C, and can be done with a system function. It's not that much of a problem today. There are two ways of executing shell commands in Java:
1. Use of
if [str1 = str2] When two strings have the same content, the length is true
If [str1!= str2] True when string str1 and str2 are unequal
If [-N str1] is true when the length of the string is greater than 0 (string non-empty)
If [-Z str1] is true when
-S file file is somefile 0 o'clock
[f]: Determines whether it is a file [-
X "/bin/ls"]: Determines whether/BIN/LS exists and has executable permissions
[-n "$var]": Judge $va R variable has a value
["$a" = "$b"]: To determine if $a and $b
Today, the script on the company server to get its own notebook on the run error, set-x tracking discovery is a variable in the self-increase operation error occurred, the error section of the script is probably like this:
#! /bin/sh
param=0
-B Returns True when file exists and is a block file
-C Returns True when file exists and is a character file
-D returns True when pathname exists and is a directory
-E Returns True when pathname specified file or directory exists
-F Returns True
Recently just learned the shell script programming method, uses the shell script to implement a colored progress bar, below will show the result to everybody.Program ResultsThis is really very simple to achieve, only need to understand some basic
There are two ways to let echo output a color
1. Define the color variable in the shell script and use ECHO-E to invoke the variable
2. When defining variables, define the ECHO-E into a variable, and then output the variable
Shell script that allows
Reproduced from: http://changyang319.com/archives/2234
NO-IP is an established free Internet domain name provider, and if you've ever had a friend using an active IP stand, you should be impressed by how NO-IP can update the domain name IP through
The principle of 0x00 broken shell loophole
Enter the inside of bash
~ Export Name= ' () {echo ' Inside name ';}; echo "Outside name";
View environment variables
~ Env|grep name
~ name= () {echo ' Inside name ';}; Echo ' outside name ';
At this
Transferred from: http://www.cnblogs.com/penghong2014/p/6065838.html
1. First download historian.py script, download address: Https://github.com/google/battery-historian2. Unzip the download and go to the
One, the read command reads the file automatically removes the space before and after the line.
A.txt: (There are spaces before and after each line)
11111
222222
3333333
A.sh:
#!/bin/bash
While Read Oneline;do
echo "$oneline"
Done
Execution
Enter HBase Shell console
$HBASE _home/bin/hbase Shell
If you have Kerberos authentication, you need to use the appropriate keytab for authentication (using the Kinit command), and then use the HBase shell to enter the certificate successfully. You
HBase provides users with a very convenient way to use it, which we call "HBase Shell."The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data to tables, listing
Seven types of files
D Directory L Symbolic link
s socket file B block device file
C-character device file p named pipe file
-Regular file regular expressions
When you extract or filter text from a file or command output. Regular Expressions (RE)
Shell Script (iii)A For Loop statement: (Unknown number of cycles)For Variable name Value listDoCommand sequenceDone(1) Bulk add users by Name listVim/root/user.txt?ZhangsanWangwuXiaobaivim/root/uadd.sh#!/bin/bashulist=$ (Cat/root/user.txt)For uname
Purpose: To determine whether a file (test.gz.txt) suffix is a zipCorrect command: if [[${filename} =~ ^test.*zip$]]Here are a few things to keep in mind:
use [[]] for its related usage see link 1;
=~ is connected, I am in use, did not pay
Shell problem Summary, this series is I as a rookie in the process of solving problems to solve the process, I hope to record down to the new scholar help.requirement : To resolve whether a file exists on the remote server1, judge whether a file
This article demonstrates how to use a shell script to complete adding a user, first making a decision if the user exists, prompting the user to already exist, or adding a new user.The sample code is as follows:1#!/bin/Bash2 3 Grep_user ()4 {5R=
测试操作符
Common Test Operators
English name
Description
-F file
file
files exist and are normal files True, that is, test expressions are set
-d file
Direct Ory
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