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
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 writing scripts in Linux, there is always the need to determine whether the existence of files, the contents of the file is empty and so on, and these operations can be implemented with the test instructions, through the man test instructions
A fun Linux shell script, the basic idea is to loop the call Cowsay
The effect is as follows
------------------------------------------------------------------------Gorgeous split Line------------------------------------------ -----------------------
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.
②
Recently in doing the server, because it is all-weather operation, the server is not said to be absolutely stable, never crash never crashed anything, so even if the downtime does not matter, the key is to be able to start in time, can not affect
Step One:
Locate the session information for the specified user, and draw up the execution script:
#!/bin/ksh
echo "conn Sys/sys as SYSDBA
select ' Alter system kill session ' ' | | Sid | | | serial# | | | ' From sys.gv\ $session where
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
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
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
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
Enterprise Practice question 1: (Production actual case): monitor MySQL master-slave synchronization is abnormal, if abnormal, send sms or mail to the administrator. Note: If there is no master-slave synchronization environment, you can use the
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
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,
1. Some common functions
Wildcard wildcard is a pattern matching function, the function model is roughly $ (wildcard parameter), the function's return value is the file that is actually found after the match, or other, depending on the argument,
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
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
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.