Shell script runs Java program

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 #---------

Writing shell scripts to start and stop programs

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

Linux Shell if introduction __linux

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

Using shell variables in sed and awk

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

Shell reads user input

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

Reverse debugging of enterprise shell and analysis of hook detection

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

Shell scripts for extracting files and merging large numbers of small files

zip

Script file name is unzip-batch.sh# bulk decompression compressed files, extract files to the specified directory#!/bin/bashFor zipfilenamefull in ' ls./*.zip 'Todo#echo "$zipfilename"Zipfilename= ' basename $zipfilenamefull 'filename=$ (basename

Shell split string stored in array

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= "

HDU 5730 Shell Necklace (CDQ Division +fft)

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

Shell Map implements Docker simple deployment script

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

operator of the Shell

an arithmetic operator: +-*/% (take more) * * (Power) 1.1 expr evaluates an expression value Expr expression (expr cannot calculate a power operation) Example: #。 /bin/bash #计算2和100的差, i.e.-98 result= ' Expr 2-100 ' echo "$result" #计算2和100的和, which

2-shell variable

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 HelloWorld of Shell programming

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

Automatic mutual trust Script Shell/expect

Cat >forallhost.sh#!/bin/bashFor i in {1..9}Do/usr/bin/expect autoyes.sh $iDoneCat >autoyesmkdir.sh#!/usr/bin/expectSet time 1Set I [lindex $argv 0]Spawn ssh 192.168.4. $i "Mkdir/root/.ssh"Expect {"Password:" {send "123456\n"}"#" {Send "hostname\n"}}

11-shell Test command

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

12-shell Process Control

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 [$

Shell script Color output (instance not edited)

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

On a Linux system, when you create a new user with the Useradd command, the shell starts with $ when you log on to the user, and the user name and path are not displayed, as follows:

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

Shell script configuration ssh password-free login

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

01-01 Shell-based data analysis

#!/usr/bin/env BashFor year in/root/downloads/data/all/*DoEcho-ne ' basename $year. gz ' "\ T"Gunzip-c $year | \awk ' {temp = substr ($ 88, 5) + 0;Q = substr ($ 93, 1);if (temp! = 9999 && q ~/[01459]/&& temp > max) max = temp}END {print Max} 'Done#!/

Total Pages: 541 1 .... 242 243 244 245 246 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.