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
Reference: http://www.cnblogs.com/dwdxdy/archive/2012/07/25/2608816.html
Often to the stylistic document for line-by-row processing, in the shell how to obtain each row of data, and then processing the row of data, and finally read the next line of
Question: How does the shell judge a filename to start with a character ~
Solve:
#var = "cn get the length of me"
#$1:parameter 1 to judge the name of the file
Var=$1
Iscn=false
# ${var:0:2} takes the Var substring from the No. 0 character and
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
Usually in the console input commands such as: sudo, SSH, ftp or modify the admin permissions of the file will require input password, but in the She ll script to run the process of how to automatically enter the password.
Below is a summary of
1, view namespace
Hbase>describe_namespace ' Ai_ns '2, List all namespace
Hbase>list_namespace,
3, Create a table under namespace
Hbase>create ' ai_ns:testtable ', ' FM1 '
the management of the table
1 See what tables are available
Today I wrote a shell script that counts the number of source lines in a directory, as follows:
#!/bin/bash
Find. -Name *. Java > Srcfilespathname
Count = $ (wc-l srcfilespathname) # Record the number of source files
echo "Number of source
The sort command sorts multiple rows of data in a behavior unit.For example, there is a text file Test_sort, which has five elements, using the sort command, the five elements can be sorted in dictionary order from small to large.If the sort command
Last time I wrote the shell, I found that VI and VIM are different: Vim is the upgrade version of VI, it is not only compatible with all VI directives, but also some new features in it. Vim is much more useful than VI.
This time the last content,
Shell--command parser, also a programming languageBash-a specific instance of the shell, zsh, bash are instances of the shell
The "Echo $SHELL" command can be used in the terminal to view the shell instance currently in use and can be switched to
The script file name is unzip-batch.sh# bulk unzip the compressed file, unzip the file to the specified directory#!/bin/bashFor zipfilenamefull in ' ls./*.zip 'Do#echo "$zipfilename"Zipfilename= ' basename $zipfilenamefull 'filename=$ (basename
1. Start HBase, go to the Bin folder under the HBase folder, and then execute the command:
HBase Shell
[Root@hadoop0 bin]# hbase shell
hbase shell; Enter ' help ' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.98.12.1
This sort looks more difficult than bubbling selection, inserting, and logically complicated.
Intuitively, I know this is not simple, a little afraid.
There is no way to give yourself a hint of psychology, be sure to read the 8 basic sorting
Unlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):PHP if (Isset ($_get["q"]) { search (q);} Else { // don't do anything }You can't write this in Sh/bash, and
This example takes the class C address as an example, if it is a Class A or class B address, the script can be modified slightlyIpaddr= '/usr/sbin/ip a | grep $1 | grep inet | awk ' {print $2} ' netmask= ' echo ${ipaddr} | awk -f '/' ' {print $2
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
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