by &&, | | Understand the function return values in the shell.I want to implement the following functions:Write a function that determines whether a string contains only numbers, and returns the corresponding flag (yes/no);By calling the function
Recent work has been compiled shell script to the customer use, will inevitably encounter some sensitive information do not want to let customers know, so the SHC script encryption method compiled binary file submitted to the customer use, found
-Execute one command at a timeM!-Executes a shell command and puts the result in the current edit bufferC-u M!=============================The following formally enters the shell edit buffer=============================-Start Shell Edit bufferM x
#!/bin/bashFor i in ' seq 448 'DoAaa= ' Sed-n "$i" P num.txt 'Bbb= ' Sed-n "$i" P text.txt '/root/cooper/sms.pl $aaa $BBBDoneNum.txt recorded 348 numbers.348 fields are recorded in the Text.txtThe effect is to take the first row in the Num.txt as
I. Type of shellIn terms of user login, the shell type is:1. Login Shell: (read environment configuration)Log in normally via a terminal:Su-usernameSu-l USERNAME2, non-logon shell: (do not read the environment configuration)Su USERNAMECommand window
On the BBS saw the Shell 13 asked the post, because the comparison is far away, afraid later can not find, put the notes over,Original address:Shell 13 AskHttp://bbs.chinaunix.net/thread-2033675-1-1.htmlPost the notes I made:, why a Shell user
All files have 3 time information, saved in the file system Atime (Access times)Is the last time the file was read or the time the file was executed Mtime (Modified times)Is the last time the file was written (it was changed when the file was
Recently, in the shell, I tried to invoke MySQL's query results, but there was a surprising result.This is the table data in MySQLA SQL statement is stored in this table to separate the statement from the shell for execution.Execution results are
in this example, the master node has the host name of Master, and the hostname of the slave node is slave1,slave2,slave3, the user name is Hadoop, and the zookeeper version used is zookeeper3.4.5. Run the following script under ROOT to achieve a
Top of the Bash shell Command and monitor The last time we talked about the PS command, although the PS command is useful in collecting process information running on the system, but there are shortcomings, PS command can only display information
Use the shortcut keys to reduce the number of mouse clicks, thereby improving efficiency, below is the summary of the Shell shortcut keys:CTRL + A cursor goes to the beginningCtrl+e cursor goes to end of lineCTRL+F cursor moves one character to the
DemandThe first two days encountered the need to extract files in a folder of about 10 levels, and then wrote this script.A file structure such as the following: Dir1 ├──a │ ├──b │ │ └──file1 │ └──file2 ├──c │ └──d │
I want to modify the file name similar to the following batch of files:Aa01_01.txtAa01_02.txtAa01_03.txtAa01_04.txtModified intoBb02_01.txtBb02_02.txtBb02_03.txtBb02_04.txtReplace the head of the file name.============================================
Shell Script Programming---judgment 1. Condition judgment Conditional judgment in Bash is divided into integer judgments, character judgments, and file judgments.
1-1 condition-judged expression: ①[expression] ( Note that the word prefix
Make the server SSH-free before running.The configuration file does not have much change to overwrite the previous configurationProfile configuration fileBak=/home/wsm/bakWebapps=/home/wsm/webapps/wsmmeasurearry=192.168.68.29
1. Test SwitchSome test instructions are included in the shell, and the following table lists the meanings of these test instructions and whether they are available for the test command, bash, Ksh.
Switch
Test
Bash
Ksh
RHEL automatically installs the zookeeper shell scriptRHEL automatically installs the zookeeper shell script
A: This script runs on Linux RHEL6.
B, C, D,...: The machine on which zookeeper cluster is to be installed, Linux RHEL6
First, you can log
Linux automatically installs JDK shell script, linuxjdkshellAutomatically install the JDK shell script in Linux
A: The machine running this script, Linux
B: The machine on which JDK is to be installed, Linux
First, log on to machine B where jdk is
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