Java executes the Linux shell command and gets the return value __java

Original: http://www.cnblogs.com/enshrineZither/p/3793459.html 1 package com.pasier.xxx.util; 2 3 Import java.io.IOException; 4 Import Java.io.InputStream; 5 Import Java.nio.charset.Charset; 6 7 Import Org.slf4j.Logger; 8 Import

LUnix How do I start and close a Java program with a shell?

I wrote a Java program with the main method entry, already packed a jar and already started running under UNIX, but I wanted to write a script file to make it easier for managers to start and shut down my Java process. Similar to Tomcat

Linux enables fast switching between JDK versions via shell scripts __linux

"Lead" on the Android website, the installation part of the JDK has the following requirements: The Master branch of Android in the Android Open source project (AOSP) needs to use Java 8, and OpenJDK is needed in Ubuntu. For a lower version, refer

Writing shell programs on Linux and executing __linux

to write a shell program in Linux and perform the steps Brief Introduction I am the first time to write a blog, do not know what should be the format and precautions, please advise. Today is about how to create a script and run it in a Linux

Linux shell script periodically cleans Tomcat log files (first draft) __linux

Shell script to clean up logs ------------------------------------------------------------------------------------------------ #!/bin/bash tomcatnum=2 #清理的路径 tomcat[0]= "/usr/local/tomcat/logs"tomcat[1]= "/data/logs/tomcat0"For ((i=0;iecho "Deleting

Batch execution of the same command shell script on a Linux cluster __linux

Execute the same command on multiple machines on a cluster because of actual development needs. For example, execute a specified script, delete files in the same directory (this is prudent ~ ~) and so on, the members of the group developed a ALLSCP (

Methods for reading file contents in Linux shell scripts (including efficiency testing) __linux

This paper mainly introduces the 4 methods of the shell reading files by line: While loop method, redirect method, pipeline method, file descriptor method. method 1:while The most efficient and commonly used method in the loop. The code is as

Linux-shell command chgrp Change Group __linux

Feature Description: change the group to which the file or directory belongs. Syntax Description:chgrp [-cfhrv][--help][--version][owned group] [file or directory ...] or chgrp [-cfhrv][--help] [--reference =][--version][file or directory ...]

Shell in-process conversion

Decimal transfer to other system> Echo ' obase=16;4196939 ' |BC turn 16> Echo ' obase=2;4196939 ' |BC turn 2> Echo ' obase=8;4196939 ' |BC turn 8 Other decimal systems in turn> Echo $ ((16#122)) or echo $ (0x122) # ext. 16> Echo $ ((2#1010)) # turn

Crontab+shell Job Flow scheduling __hadoop

In the previous article, we had a simple reference to the pseudo code of the shell or Python dispatch hive, and today we are enriching the pseudocode http://blog.csdn.net/haohaixingyun/article/details/51821444 Note that in the actual production

Set IP address shell script

#!/bin/bashA="IPADDR.*"B="NETMASK.*"C="GATEWAY.*"D="DNS1.*"E="/etc/sysconfig/network-scripts/ifcfg-eth1"F="cat $E | sed -n ‘/BOOTP/p‘"if [ ! "$F" = "BOOTPROTO=dhcp" ] thenread -t 30 -p "Please enter the IP address:" IPread -t 30 -p "Please enter

The internal variables of shell scripting learning

One$BASH    The path of the Bash 's binary program file  Two$BASH_ENVThis environment variable will point to a bash startup file that will be read when a script is called.Three$BASH_SUBSHELLThis variable is used to indicate the level of the child

Kettle under Linux for shell scripts to perform conversion tasks

1 Create a good conversion under Windows and place it under one of the Linux folders. such as: Put the 0816_em.ktr file under the/home/cfj/kettle/testdemo.Note that the database user name and password may need to be changed if it is a job file such

Shell daily Practice-find intruders by monitoring users ' logins

#!/usr/bin/bash#用户检测入侵工具Authlog=/var/log/secureif [[-N $]];thenAuthlog=$1echo "Using Log File: $AUTHLOG"FiLog=/tmp/valid.$$.logGrep-v "Invalid" $AUTHLOG > $LOG #将系统中有效的用户users=$ (grep "Failed password" $LOG |awk ' {print $ (NF-5)} ' |sort|uniq) #

Linux exercises-shell Script programming basics (in construction)

1, write script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size2, scripting/root/bin/backup.sh, can be

Shell Installation glibc

#!/bin/bashnum=`cat /proc/cpuinfo | grep processor | wc -l`yum install wget gcccd /usr/local/src/wget -c http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gztar -xf glibc-2.14.tar.gz cd glibc-2.14 && mkdir build../configure --prefix=/usr --disable-profile

Shell Installation glibc

#!/bin/bashnum=`cat /proc/cpuinfo | grep processor | wc -l`yum install wget gcccd /usr/local/src/wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gztar -xf glibc-2.14.tar.gz cd glibc-2.14 && mkdir build../configure --prefix=/usr --disable-profile

Shell name origin

1. IntroductionShell, the Chinese name shell, is used to describe the relationship between the user, the operating system, and the hardware.The computer can not operate without hardware, but the user can not directly operate the hardware, the

Shell BASIC Programming

Most basic: Remember the previous:#!/bin/bash, and the file suffix name is generally. shVI HelloWorld. SH #!/bin/bashecho"helloworld"Then remember to add permissions to the script, because the default is read and write permissions, default to all

Commands commonly used in shell scripts (i)

seq 1 100The notation of the seriesWc-l count Rows-C bytes-W wordsbasename returns a basic file name for a stringDirName leave the non-directory part except the file nameRead-p "" Name prints a hint and waits for input input information to be given

Total Pages: 541 1 .... 455 456 457 458 459 .... 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.