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
When you use a shell to write a program, you sometimes have to confront the problem of interaction--unfortunately, the shell can't automatically complete the interaction. If the interactive content is many, it is convenient to apply expect script
#!/bin/sh
Echo-n "Welcome to I programming World"
Echo-n "This program is a calculator"
Operator= "+-x/exit"
echo "Please input two digits:"
Read Number1 number2
Select I in $operator
Todo
Case $i in
+)
result=$ (($number 1+ $number 2))
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
[Zxw@host1 ~]$ nl shscp/dump_backup_my.sh1 #!/bin/bash2 #dump MySQL data once per day, the reserve last 7 days data.3 #zhao Xiaowei4 #2014.08.275 Path=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:~/bin6 Export PATH7 dir=
Reprint please indicate source http://blog.csdn.net/imred/article/details/40951125
Under Linux to see some txt files often appear some garbled problem, so I wrote a shell script to GB2312 code into UTF-8 code
#!/bin/bash
#格式:./gb2312_2_utf8.sh
[Root@centos65 liumengyang]# cat test.sh
#!/bin/sh
#if The process Exists,kill it
pid=$ (Ps-ef|grep java| awk ' {print $} ')
pidname=$ (ps-ef|grep java|grep-v ' grep ' |awk ' {print} ')
#judge If the process is Running.if Not,restart.
If
on the shell:
0 indicates standard input, input data from the terminal, generally refers to the keyboard
1 indicates the standard output, the data displays to the terminal, generally refers to the screen
2 indicates standard error output, Error
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
http://www.51testing.com/?uid-45739-action-viewspace-itemid-185211
JoinSimilar to the Join method in db, there is also a left join right join INNER JOIN, etc.Specifies the way the join is specified by the parameter-A.-A1 represents a row that
Turn from: http://blog.csdn.net/edei2004/article/details/3694021
Many people think that telnet, like passwd and Su, cannot be turned on by pipes and inputs to make it work automatically, but Telnet actually supports input steering. Although,
Read two files at the same time, and merge their peers into one line to write to a merged file
Shell script:
#!/bin/bash
#set
-x CD ' dirname ' $ '/. /
inas_script_root= ' pwd '
function Make_if_no_existis_dir ()
{local
dir=$1
if [!-e ' $
Here are two ways to use the shell's regular expressions. use method One:
#赋值给变量var
read var
#定义regex正则表达式
regex= "[0-9]"
if [$var =~ $regex]];then
#match
#do Something
fi
For example, to match the input, the requirement must be a number
Specify the script interpreter
#!/bin/bash
Note: 1, the declaration can only be placed in the first line of the script, indicating that the script uses the Bash interpreter to interpret execution, otherwise it will be interpreted as Comment 2,
HBase contains a shell that can communicate with HBase. HBase uses the Hadoop file system to store data. All these tasks occur in HDFs. Here are some of the
Common HBase shell commands.
Data Manipulation language
Command
Let's take a look at some of the basic operations commands of the HBase shell, and I've listed several common hbase shell commands, as follows:
Name
Command-expression
Create a table
Create ' table name ', ' column
First, Introduction
1.
Cal Calendar
LS Viewing files and directories
WHOAMI Viewing Current user information
Users or who or W view the current online user
Logout Sign Out
Shutdown or Powoff shut down the system
Init 6 or Reroot reboot system
passwd
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
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