When we deploy the project on Linux, we often start the program through a shell, or even call the Java program periodically via the Crontab timer task, but one of the strangest questions is that I wrote a shell script like this:
#!/bin/sh #---------
The two-day project online
I've been busy.
Three days overtime.
But there's still a harvest.
Premise:
When you write the startup script start.sh, cycle to start the change process
While True
Java-jar Xxx.jar
Done
When starting, of
1. Introduction
Use in shell programming to determine parameters within the IF statement–b returns True when file exists and is a block file-C Returns True when file exists and is a character file-D returns True when pathname exists and is a
Reprinted from Jrckkyy final edit Zengzhaonong
Using shell variables in sed and awk----------------------------------------------x=mmSed ' s/ab/' $x '/g ' B.COrSed ' s/ab/' "$x" '/g ' B.CSed ' s/' "$val" '//' UrfileThe most recent process of
14.2 reading user input
14.2.1 Variable
In the previous chapter we talked about how to define or cancel variables, which can be set to the current shell's local variables, or environment variables. If your shell script does not need to invoke other
1. Write at the beginning
Recently in the study Bang Bang shell, in the process of debugging encountered reverse debugging, is very distressed, and every debugging will be interrupted, a friend sent a post "1" introduced one of the Anti-tune, after
In shell programming, it is often necessary to divide a string separated by a particular delimiter into an array, and in most cases we first think of using awkHowever, it is more convenient to actually use the shell's own split array function. IfA= "
Description gives beads with lengths of 1~n, and beads of length I have a[i], each with an infinite number of beads, asking how many options are used to string the beads into a chain of length n input Multiple sets of use cases, each set of use
With the popularity of Docker, the application of Docker is more and more, the work is certainly not necessary, but the individual feel that some of Docker commands require a bit more parameters, such as running a container, –name to the container
When defining a variable, the variable name does not have a dollar sign (required for variables in the $,php language), such as:Your_name= "Runoob.com"Attention There can be no spaces between the variable name and the equals sign, which may not be
The difference between/bin/sh and/bin/bashSH: If there is an error in the previous statement, the command after the error statement does not executeBASH: If there is an error in the previous statement, the following command will also executeThe
The test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file.Numerical Test-eq equalsis True-ne Not equal tois True-gt greater thanis True-ge greater than or equal tois
You can't write this in Sh/bash, and if the Else branch doesn't have a statement execution, don't write this else.If ElseifIf statement syntax format:If conditionThenCommand1Command2...CommandNFiWrite a line (for the terminal command prompt):If [$
Color output via echo output, need to add-EECHO-E "\033[background color; font Color \033[0m"Background color40 Setting a black background41 Setting the red background42 Setting the green background43 Setting the brown background44 Setting the blue
Add the following code to the ~/.bash_profile, if none of the files can be created by yourself: Java code
VI ~/.bash_profile
#加入
#export ps1=' [[email protected] w]$ '
Uppercase W represents the last path, and lowercase w for
Through the shell script to configure the password-free login, divided into two scripts, one is the configuration file config.env, one is the formal script sshkey.sh.# config.envExport host_user=(root) export PASSWD=(a) export ssh_host= (192.168. 16
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.