A shell to facilitate installation of makefile files

#! /Bin/sh Arg_count =$ # If [$ arg_count-EQ 0]; then Echo "error: Enter the file name to install ." Echo "Usage: Install file 1 [file 2 file 3 File 4 File 5... file N]" Exit Fi For filename in $ *DoIf [-F $ filename]; thenTMP = install _ $

Replace Linux Shell Parameters

The $ symbol in Bash is used to replace the parameter name with the value represented by the parameter. For $, braces are optional, that is, $ A and $ {A} represent the same parameter. $ {} There are several expressions with colons: $

Shell decompression script

The case expression can be used to match a given string, not a number (do not confuse switch... case in C ). Case... in...) do something here esac The file command can identify the file type of a given file, for example, file lf.gz. The output

Linux Shell FTP upload and download operations

FTP-I-v-n FTP download, open IP port is the connection server, User Username Password is the login, CD/admin is the CD to the Admin directory under the FTP server, LCD D: /Shell/data is used to change the local working directory to the

Shell script debugging-run log 2

Shell script debugging-run log 1   This article mainly describes how to output debug logs in shell scripts.   C/C ++ debug log In C/C ++, _ file __, _ FUNC __, _ line _ indicates which log of the current row comes fromSource codeWhich

Execute the jar method in Shell

Counter = 'ps-Ef | grep sync. bankcardbatchpay | grep-V grep | WC-l'If ["$ counter"-EQ 0]; thenEcho "No sync. bankcardbatchpay is running"ElseKill-9 'ps-Ef | grep sync. bankcardbatchpay | grep-V grep | awk '{print $2 }''Fi Classpath =

A simple shell Backdoor

A simple shell Backdoor Author: Pony/smallhorse [e.s. t VIP] (it doesn't matter if you do not write this e.s. t VIP)Source: evil baboons China Recently, I was bored and thought about writing a simple shell backdoor. At the same time, anti-virus

Some self-written Linux Shell functions

1. Get user input.The parameter is the regular expression that is correctly checked by the input prompt, and the default value is entered.ReturnThe correct user input is returned. Function get_input (){Prompt = $1RegEx = $2Default = $3If ["x $

Shell splits strings into Arrays

#! /Bin/bash A = "one, two, three, four" # To split $ A, you can: Old_ifs = "$ ifs" Ifs = "," Arr = ($) Ifs = "$ old_ifs" For s in $ {arr [@]} Do Echo "$ S" Done The above code will output One Two Three Four Arr = ($ A) is used to

Shell basic notes

Note: No space is allowed between the left and right sides of "=". The semicolon program 1 # is not required at the end of the bash statement #! /Bin/sh # echo somethingecho "Hello World" Echo "Hello !! "CD/root/export topmkdir./ABC Program 2,

Shell Summary of special variables: Location variables $1, $ *, $?

$1 indicates the first parameter. $ * indicates all parameters entered by the user. The hello1 script is as follows. A location parameter is acceptable. #! /Bin/bash Echo $1   Run the Script:./hello1 "Hello World" and output Hello World on the

Accurately clear the Squid cache using shell scripts

This script was modified on the cache cleanup script of Zhang banquet, mainly to add the if option, and select the address of the cached file based on the $1 parameter type (because $1 is not fixed, sometimes it is a specific JPG type, sometimes it

Shell (4) mongo.doc

1) Create FunctionName { ... } Or: Name (){ ... }   2) Call Use the function name directly. The function can be called only after it is defined; When a function has the same name, the new definition will overwrite the old definition and no

Shell (10) commonly used command. Doc

Ls -L, show the hard link count; -I, show I-node -H, human readable -T, sort by modify time -S, sort by size -R, -- reverse -R, show content of sub-Dir -V, sort by version  CP -P,Retain source file attributes, such as the modification time -L,

Write an awk script in the shell script to extract data. Note the format. Use shell variables in the awk, convert the numeric strings in the awk to numbers, and compare the strings in the awk.

In awk programming, do not forget that awk processes regular expressions. There are many internal functions, especially string processing functions. Calling these functions can reduce the workload. 1. Format // Note \ There cannot be spaces behind

Use shell array, good, keep learning later

I don't know when I wrote something, But I was found by archaeology when I sorted out the documents. I just smiled at those people who were bored. If the errors in this article cause all mental losses to you, contact the insurance company! Of course

Shell script batch modifies a string in the file (without correction or modifying the ELF File)

#! /Bin/sh #*********************************** **************************************** * ** # Change "/bin/sh" to "/system/bin/sh "##****************** **************************************** * ******************/if [$ uid! = 0] Then ECHO "failed:

Unix shell comparison

Unix shell programming Summary of some conditions -B file: if the file exists and is a special block file, it is true.-C file: if the file exists and is a special character file, it is true.-D file: if the file exists and is a directory, it is true.-

Shell script used to detect Processes

Shell script used to detect Processes 10:38:08 | category: centos | font size subscription Script 1: #! /Bin/sh Program = XXXX # process name Sn = 'ps-Ef | grep $ program | grep-V grep | awk '{print $2} ''# obtain the process port numberIf ["$ {sn}"

Example of using the while loop in Shell

#! /Bin/sh # Filename: 2.sh B = 9 E = 15 Tmpb = $ B While [$ tmpb-Le $ E] Do Echo $ tmpb # Tmpb = 'expr $ tmpb + 1' // OK Tmpb = $ (expr $ tmpb + 1) Done After the script is executed, the output result is: 9101112131415   Note: The

Total Pages: 541 1 .... 487 488 489 490 491 .... 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.