Using the process and runtime two classes, the return value is obtained by the getInputStream () method of the Process class[Plain] View plain copy package ark; import java.io.bufferedreader; Import java.io.IOException;
Share a shell script executed by your own Hadoop,
But for those who write shell scripts, it's not going to work.
People who can't write shell scripts seem to be confused.
If you are interested in learning, you can contact in private. As for
The
Write:
The shell script is actually a plain text file (ASCII), and we can edit the file to help us execute multiple instructions at a time, or use some operational and logical judgments to help us achieve certain functions. The same considerations
Well, it's purely memo-type.
1. Install peanut shell and register a free domain name.
2. The network environment determines the future operation
① If your machine is connected directly to the extranet, the router is not used, so you can use it.
②
Tee Cat >> Test &m
Tee
To redirect output to files and screens at the same time:
Date | Tee now
Cat >> test
Use a custom delimiter to create a documentDelimiter is a delimiter, customizable, and we're using append redirectionThe above command
The 1.expr command is generally used for integer values in the general format:
Expr argument operator argument
The general usage is to do arithmetic operations using expr, such as:
[Root@centos ~]# expr 10 + 20
30
$expr 30/3/2
5
(Note that operators
how hbase is accessed1. Native Java API: The most conventional and efficient way to access;2, hbase shell:hbase command line tool, the simplest interface, suitable for hbase management use;3, Thrift Gateway: The use of Thrift serialization
Shell to bulk modify file name under folder:
Parameters: Incoming file path, such as:
$./batch_rename_files.bat /home/xx/channel/
#!/bin/bash
echo "Start programming ..."
# #for i in ' ls * ' CD $
# #for i in ' ls-r | grep "erl*" '
The Bash command explains that the package program contains some internal commands. Internal commands are invisible in the directory list, and they are provided by the shell itself. Common internal commands are: Echo,eval,exec,export, ReadOnly, read,
Normal way:#! /bin/bashecho "Please enter your name:" Read Nameecho "your name is $name." 123456 result: [Email protected] ~]#./jiaohu.sh Please enter your name:yvesyour name is Yves. [[email protected] ~]# 12345
The following two ways to
first, use the For loop to calculate the 1-100 and. Here I list two ways, please peer more suggestions. Propose a better method or a more optimized small script program。1. With for I in mode:[[email protected] ~]# vim forin.sh #!bin/bash#The for i
We can pass parameters to the script when executing the Shell script, and the format of the parameters obtained in the script is:$n.n represents a number, 1 is the first argument to execute the script, 2 is the second argument to execute the script,
Variable setting rules1. Variable names can consist of letters, numbers, and underscores, but cannot begin with numbers;2, in bash, the default type of the variable is a string, if you want to do numeric operations, you must specify the variable
1.shell is a batch program, similar to the Windows BAT file2. When writing the shell, the first line should be #! /bin/bash begins Execute the file using the bash shell.3. Use the # comment (preferably note the function of the shell script in case
Learning about Linux, some time ago to learn the shell script, wrote a very simple script, remote other virtual machine to partition the disk, their own pure hand, but also a record of individual learning process, the great God can skip!Here is the
Shell Special Symbol Cut command* * indicates wildcard characters?? represents an arbitrary character# #号注释字符, the annotated content will not take effectThe \ \ symbol denotes the caret character, leaving the special symbol out of the original
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