1. Must enter the pure digit, ignores similar ' 2 ' ' 3 ' the number with the space input before and after2. The digital range must be controlled in 10 ~ 90
#!/bin/bash status= ' err ' start=10 end=90 while [$status!= ' OK '] do ifs= ' read input
In a Linux environment, automate installation steps for multiple packages:
1, find the software package, extract the name of the package to establish the decompression path (in order to let us more clearly find our files)
Pkg= ' Find
Modifying a row record in an XML file with a shell script
As before, suppose the following XML file:
Web.xml has the following contents:
cookieName
sessionName
Requirements: Now you need to replace the value of cookiename with a shell
Replacing a row record in a property file with a shell script
Hypothetical as subordinate file Demo.properties
User.name=test
user.password=123456
...............................
Requirements: First you need to replace the value values of
if else and greater than, less than, equal to logical expressionIf ...; Then
....
Elif ...; Then
....
Else
....
fi [F "somefile"]: judge whether it is a file
[-X "/bin/ls"]: Determine if/bin/ls exists and has executable permissions
[-N ' $var]:
It's easier to turn on the internet than to use awk.
Given two files a.txt and b.txt, each row is a record (assuming there are no duplicates), the intersection of two sets is required, the set of sets, the difference set, and the output results
Sometimes we need to repeat the previous commands in Bash. You can certainly use the UP ARROW keys to view the commands you've run before, but this article describes some of the better ways, such as!!,!a,!number,!-number,!$,ctrl+r shortcuts. This
Hbase is a distributed, column-oriented, open-source database that is built on Google's bigtable theory and based on the Hadoop HDFs file system. HBase differs from a generic relational database (RDBMS). is a database that is suitable for
Preface
Pre-installation requirements, using Hadoop, basically do not need to change anything:
1. Java Environment
2. Hadoop (HBase-based HDFs)
3, zookeeper (I use the independent zookeeper here, because previously used has been installed, of
Example No. 2As a shell writer, often face the problem of inconsistent data format, the data standard session output is a need to solve the problem, this example takes MySQL time as an example, the script enters the month, the day, the year three
Linux Shell Basics
Terminal printing
#!/bin/bash#The printf of Linux termnal,Include "echo,printf"#author by woon echo "The shell\`s name is $0"#examples of echo,printf#默认打印。输出换行echo "Hello World!" echo ‘Hello World!‘#echo -n参数接受不换行输出echo -n
ifMulti-branch statement practice#!/bin/bashread-p " Please enter 100 m running seconds: "IIf [$i-lt] && [$i-GT 0]Thenecho " Enter the final "read-p " enter male and female "aif [$a = male]Thenecho " into the men's group "elif [$a = female]Thenecho "
First step: Use a text editor to create a text file
The first line must include the shell declaration sequence: #!
#!/bin/bash
Add Comment
Comments start with #
Step two: Run the script
About SEDSed is an online editor that processes a single line of content at a time. When processing, the currently processed rows are stored in a temporary buffer called pattern space, followed by the SED command to process the contents of the
In what's a shell and what is Bash, it explains what the shell is, and then see what features it provides:1. Interoperable, and non-interactive use of the shell. In interactive mode, the shell receives input from the keyboard, and in non-interactive
The testing Test command in shell programming can basically be divided into 3 data types, each of which is different. Individuals are more inclined to understand the rules of writing conditional statements, that is, test plus conditional plus
RPYC makes it easy to implement remote method calls, while Plumbum can implement a shell-like encoding in Python:The specific implementation code is as follows:server.pyImport rpycfrom rpyc.utils.server import threadedserverfrom plumbum import
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.