Shell base syntax and monitoring process does not have a restart

transcoding# Dos2unix./test.shPermissions#chmod a+x./test.shGrammarVariableVar= "111"Echo $varEcho ${var}Operationno1=4;no2=5;Let Result=no1+no2echo $result;Self-increment self-reductionLet no++Let no--[] and let similarresult=$[No1 +

Lua invokes shell script

In Lua, Os.execute can execute DOS commands, but returns the system status code, which is the default output.Io.popen () can also execute DOS commands, but returns a file. egCopy the Code code as follows:Local T = Io.popen (' svn help ')Local A =

Shell scripts add users in bulk

Add the appropriate user account to the Linux service and the initial password is "123456". You can specify a list file for all users, and then write a script named uadduser.sh.[[email protected] ~]# vim/root/users.txt //Create a new list file that

A comparison of integers in the shell

-eq equals, such as: if ["$a"-eq "$b"]-ne not equal to, such as: if ["$a"-ne "$b"]-GT greater than, such as: if ["$a"-gt "$b"]-ge greater than equals, such as: if ["$a"-ge "$b"]-lt less than, such as: if ["$a"-lt "$b"]-le less than equals, such as:

The shell file contains

Create a two shell script file. The test1.sh code is as follows:#!/bin/bashurl= "Http://www.cnblogs.com/freescience"The test2.sh code is as follows:#!/bin/bash# use. To reference the test1.sh file. ./test1.sh# or use the following include file code #

Linux shell built-in judgment

Built-in judgment, when successful returns 0, does not successfully return nonzeroTest-judging expression[Judgment expression] Note must be left blank before and afterNumeric operations-eq equals-ne Not equal to-GT Greater than-ge greater than or

Shell Script Combat

Want to write a script, found that all forget, egg pain, while recalling the side of the writing, finally finished, affixed to the following:1#!/bin/Bash2 #Program:3 # can help you quickly redeploy the project4 #History:5# ./ ,/TenShichaogeng First

Whether the shell monitoring process exists

1. Direct to the code: I am this is two programs. Most likely to write a function[email protected] src]# cat checkprocess.sh#!/bin/bashCheckprocess (){Ps-ef|grep $1|grep-v grepIf [$?! = 0];thenSystemctl Start $Elseecho "It ' s

A common way for Shell to intercept strings

1, get the character from the front 8, the implementation method is as follows:a=123456789$ expr substr $a 1 8$ echo $a |cut-c 1-8echo $$ echo $a |dd Bs=1 count=8 2>/dev/null2. Interception by the specified string(1) The first method:A string after

Linux Shell Code

1#! /bin/Bash2 3#/python2292/cnedmp/etlscript/cnedmp_etl_v1.0/Testhis4load_path=$ (CD $ (dirname$0);pwd)5#/python2292/cnedmp/etlscript/cnedmp_etl_v1.06deploy_path=$ (CD $ (dirname$LOAD _path);pwd)7#/python2292/cnedmp/Etlscript8base_path=$ (CD"$

View the currently supported shell

/etc/shells more/etc/shells/bin/sh/bin/bash/sbin/nologin/usr/bin/sh/ usr/bin/bash/usr/sbin/nologin/bin/tcsh/bin/cshECHO-E Related escape character\ \ input \\a Output Warning tone\b Backspace, i.e. delete one character to the left\c Remove line

Shell Script sed tool

Overview of the SED tools (streaming editor)Non-interactive, filter and modify text based on pattern matchingLine by row and output the results to the screencan achieve the output of the text, increase, delete, change, check and other operationsSed

Name of the shell-3-file

1. Generate files of any sizeif=/dev/zero of=junk.data bs=1m count=1recorded 1+0 read- inrecorded the writing of 1+0.1048576 bytes (1.0 MB) copied,0.00219263 sec,478 MB / secIf represents the input file, The of is the output file,the BS size,

Shell special variables and forward and backward task switching methods

Echo ' $ Get the file name of the currently executing shell script: ' $Echo ' $n gets the nth parameter value of the currently executing shell script: ' $ ' =$1 ' $ =$2 ' $ ' =$3Echo ' $* gets all the parameters of the currently executing shell

Special variables for the Shell

2017-08-021.$0 gets the name or full path of the current scriptCat Name.shlinux Shellsh Name.shecho $0name.sh2. $n (n >=1) get the script nth parameter note the usage of n>9 ${n}Example: SH name.sh aa bb cc dd EEecho $ $4 $ ${20}Output: AA bb cc dd

Shell Match single quotation mark

Https://stackoverflow.com/questions/91110/how-to-match-a-single-quote-in-sedToday is looking at an example of sed '/larry\ 's ' Larry. The results are not matched. Google is not aware of the query. Matching single quotation marks cannot be simply

Bulk change read and write permissions for all files under a file using the Terminal shell command

The previously installed directory on OpenFire encountered this problem, and today again. You need to change all subdirectories below a directory and the three permissions of the file: the user reads and writes. The administrator reads and writes.

Java Shell Sort

The code is as follows:public class Shellsort {public static void Sellsort (Datawrap [] data) {System.out.println ("start sort:"); int length = Data.lengt The h;//h variable holds the variable increment int h = 1;//The maximum value of the increment

Sort-shell Sort

In the insert sort, all elements are compared to the previous element, and the position is replaced. So the number of exchanges is the square level of N. In extreme cases, if the smallest element is on the far right, you need to displace each and

Use X-shell on win10 to connect to Ubuntu in a virtual machine

1. In Ubuntu, install SSH:sudo apt-get update # to complete system updatescd/etc/init.d/# See if SSH service is installedsudo apt-get install Openssh-server # for installationsudo etc/init.d/ssh Restart # Restart service, others are:

Total Pages: 541 1 .... 519 520 521 522 523 .... 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.