Today in one of their technical group was asked such a question, and then the popular explanation, make a record, we see whether the explanation is clear!
The shell may often see: >/dev/null 2>&1
The results of the command can be defined in% > to
For Java Applications (non-Web applications), after deployment, a startup script is often required to load some Third-party jar packs and start the application.
For Java applications, I generally prefer to write the directory structure of a program
The waste CPU opens the shell to open the process.
1. Preparation work
2, this step with a knife when you must be careful to be patient, do not scratch the CPU cover and the following section, do not be afraid of no place to row, the CPU
If you need to write a section to interact with the user, and need to input some sensitive information (for example: User password, license, etc.), the direct use of printf+read, the user input information will be displayed on the screen, which is
There are times when you need to extract files from the RPM package without installing and installing RPM-related libraries and programs, and this little green script can help you achieve your wish.
Note:1. This script comes from the Internet, the
When a program fails, there are times when you want to troubleshoot problems by understanding the system tuning that the process is executing. You can usually use Strace to track. But Strace is no help when the process is already in the D state
There was a problem working with files today, and the for loop is problematic when the file name contains spaces.
For example, I create 3 files in the current folder that contain spaces:
Copy Code code as follows:
First, we need to increase the user's ability to execute the script, that is,
Copy Code code as follows:
String cmdstring = "chmod a+x test.sh";
Process proc = Runtime.getruntime (). exec (cmdstring);
Proc.waitfor (); Block until the
Search on the Internet to find a great God wrote Shell Repair Bash Vulnerability script, feel very good, dragged to my blog to share to everyone.
Script content:
Copy Code code as follows:
#/bin/bash
#Author Alex Fang. Updates may
In the process of database operation, the Shell script provides great convenience for operation and maintenance. A shell script parameter passed as a variable to SQL and a SQL script is one of the scenarios that DBAs often encounter. This article
1. Shell function: The shell allows a set of command sets or statements to form an available block called a shell function.
A function consists of two parts: a function title, a function body.
The title is the function name. A function body is a
Write a script that can generate random passwords, if you want pure numbers or only letters or case, can be customized, I write a full element here.
#!/bin/bash
# Author:honway.liu #
date:2013-07-19 #
concate:gm100861@gmail.com
len=90
str= (a B C
Avoid common problems with timed task scripts
Many scripts are actually used in the form of timed tasks rather than hand-run. However, scripts that implement the same functionality may encounter different problems in both modes of operation.
A
Transferred from: https://zhidao.baidu.com/question/357781350.html while Read-u3 i && Read-u4 J; Do Echo done34Read-u3 I means to read a row of data in the I variable from FD # 3rd (file descriptor, filename descriptor), so you know what Read-u4 J
1. Semicolons separate multiple commands.2. There are no spaces in the middle of the variable assignment.3. When constructing pipelines, try to make the amount of data in each phase less. If the two tasks are not related to the order, then the
The SED usage of LinuxSed is a good file processing tool, itself is a pipe command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work, the following first understand the use of
First, the text processing1. Extract key word frequency times by row (for example, 5th column)awk ' begin{fs= ' | '} {a[$5]+=1;} END {for (i in a) print I ":" A[i];} ' Opt. Forumlogicnewserver_action_20161107.log | SORT-NRK 2-t ': '2, log users per
#!/bin/bashExport Chknum=1#shell搅拌存放目录 (The output log file is also stored in the directory after it is executed)Echo 3 >/wls/wls81/shellSyncWhile [$chknum-ge 0]Doecho "-------------------------------------------------------" >> Trace.logmt= ' Free |
Testing and comparison of shell scriptsTest command: Checks the file type and compares the value (depending on the execution result of the expression (true or false), returns an exit status. )NAMETest-check file types and compare
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