Shell script for running Java programs under Linux

Vim creates a new shell file, such as my file named Java_run, which reads: echo "Please enter the Java file path you want to compile:" Read Path #分离路径和文件名var1= ' dirname $path ' #路径Var2= ' basename $path ' #文件名CD $var 1Javac $var 2Java ${var2%.*}

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

On the ">/dev/null 2>&1" of shell

From: http://www.ixdba.net/a/os/linux/2010/0422/35.html "When reprinted, please indicate the source of the article and the author's information and this statement in the form of a hyperlink"Original link: http://www.ixdba.net/a/os/linux/2010/0422/35

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

"Shell Learning Notes" Curl Command summary

2014-12-16 20:34, Evans, Hai Hui =========== Curl Command Summary 1. Download Curl-o [FileName] www.baidu.com 2. Display HTTP Request header information Curl-i www.baidu.com Display HTTP response header information Curl-i www.baidu.com 3.

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

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

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

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

Mac Shell Terminal Edit command line shortcut keys

CTRL + A//move to the beginningCtrl+e//Move to end of line===========linux System with ============Alt+a//move to the word header where the cursor is locatedAlt+e//move to the end of the word where the cursor isAlt+d//delete cursor at end of

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

There are two ways to run a Shell script:

1. As an executable programSave the above code as test.sh and CD to the appropriate directory:+./test. #使脚本具有执行权限./test. #执行脚本 Note, be sure to write ./test.sh, not test.sh, run other binary programs also, the direct write Test.sh,linux

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 Programming Test Command

The testing Test command in shell programming can basically be divided into 3 data types, each of which is different. Individuals are more inclined to understand the rules of writing conditional statements, that is, test plus conditional plus

Methods for referencing shell variables in awk code

A fragrant chestnut is better than words#!/bin/bashfoo= "Good" # Without spaces bar= "Hello World" # with spaces awk ' BEGIN {print ' $foo ' "; "'" $bar "'"} 'The pest above maintains the usual practice of enclosing the awk code in single

Spark-shell Boot Error

18/06/24 16:41:40 ERROR Spark. Sparkcontext:error initializing Sparkcontext.Java.net.BindException:Cannot assign requested Address:service ' Sparkdriver ' failed after + retries (starting from 0)! Consider explicitly setting the appropriate port for

A simple example distinguishes between *,+ in a Linux shell regular expression.

1,linux The difference between the shell regular expression * and the + numberExample Memory:[email protected] data]# Touch test.txt[Email protected] data]# cat>>test.txt> Gooood> Goood> Good> God> GD> EOF* indicates repeating the preceding

Total Pages: 541 1 .... 278 279 280 281 282 .... 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.