In the work often encountered in a file to record a number of file name or picture name, in the specified directory to find all the files in this file, but the specified directory does not have all the names recorded in the file, you need to find in
The file name of the shell itself
$1~ $n Each parameter value added to the shell. $ $ is the 1th parameter, and the $ = is the 2nd parameter ...
$$ the shell itself PID (ProcessID)
$! PID of the Shell's last running background process
$? End
Man test can see the string -n string the length of STRING is nonzero STRING equivalent to -n string -z string the length of string is zero STRING1 = STRING2 the strings are equal
( a ) first look at how the Shell script executes, theShell script suffix is the sh file.1 sh test.sh2 Source test.shWhat is the difference between these two ways? The script in test.sh is simple , assigning a name variable after typing it from the
Problem situation:1. Hive Shell Chinese garbled 2.Hbase Shell Chinese garbled Solutions 1At the command line, enterExport lang= "en_US. UTF-8 "then enterTemporarily change system encodingThis method is only temporary.Workaround 2sudo
This article is reproduced from http://blog.chinaunix.net/uid-22566367-id-381955.htmlSelf-documenting content. The shell script that encountered the relevant content in the project. Record in this placestring1="111 222 333 4444"echo $STRING 1echo"$
Method One: Set the terminal BACKSPACE to ASCII 127Method Two: Use CTRL + BACKSPACE keyPress CTRL + BACKSPACE key at the same time to delete.Method Three: Use Ctrl+w to send signals to delete entire wordsDirectly send the deletion of the whole word
Maple City Prodigal Original, reproduced please indicate the source!For more technical blog posts, see Personal blog: https://fengchenglangzi.000webhostapp.combh19890922QQ445718526, 490425557650) this.width=650; "Src="
What is a function?
1) Basic concept of function
functions:function, refers to the code of a separate function as a whole and take a name for it, that is, named code snippet, also known as function;
function is an important component of
1. StartCD /bin$./start-hbase.sh2. Start HBase Shell# Find Hadoop-hbase DFS filesHadoop fs-ls/hbase#start ShellHBase Shell#Run a command to verify this cluster is actually running#List3. Logs ConfigurationChange the default by editing
Understanding shell ScriptsThe shell script works in two ways:Interactive: Enter a command that the shell interprets and executes a commandBatch: Write many commands to the shell script, and the shell executes all commands at onceShell a script is a
Shell script loops over TV channel scripts#!/system/bin/shtime=$1if [[$time 0]]doecho ' run times $time "Input keyevent 166input keyevent 166input keyevent 167let" time--"Doneecho" Run End "fi Shell Script Switch TV channel
Alias:Alias ll= "Ls-l"Steps to find the command:
If you are using a relative command (such as./command directly executing the command file in the current directory), locate the file directly in the current directory and execute it.
Absolute
Different shells have different functions, the shell also determines the syntax of the function in the script, the default shell in Linux is/bin/bash, the popular shell has ash, bash, Ksh, CSH, zsh, and so on, different shells have their own
Show VariablesThe read command reads a row from the standard input and assigns the value of each field in the input row to the shell variable#!/bin/shread name echo "$name It is a test"The above code is saved as test.sh,name to receive the standard
Transfer from http://blog.csdn.net/wangtaoking1/article/details/9838571 The main record is the concurrency and serial execution of commands in the shell script.By default, the commands in the shell script are executed serially, and must wait until
Special positional parameter variables in 1.shell$: Gets the file name of the currently executing shell script, including the script path if the execution script contains a path$n: Gets the nth parameter of the currently executing shell script, n=1..
1. Demandfind all unused IPs in a 192.168.0.* network segment2. Realize We know that finding methods that do not use IP can be done using the ping command. For a single IP judgment, use the following command$Ping-C1 192.168.0.1PING192.168.0.1(192.168
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.