${},# #和 percent usage in the shell

Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Remove the last/and left string: my.file.txt$

Linux Shell If Judgment statement

No matter what programming language is inseparable from conditional judgment. The shell is no exception.The approximate format is as follows:If List ThenDo something hereElif List ThenDo another thing hereElseDo something else hereFiAn

Inter-Program Collaboration mode-shell out

Inter-Program Collaboration mode-shell outShell out this noun although not how to hear, but perhaps in silent use, plainly is through a program through the form of a command to invoke another program, that is, System (2) systems call. The existence

Shell Change Password to original password

After the password expires, change the password to the original password, the server a lot of work, write scripts to complete.After logging in, modify the prompt to: doraemon# convenient expect matchModify Lang=c, prompt for English to prevent

Shell Login Remote Server

More field servers, password 3 months expired, at the expiry of the need to change the password.Write with expect, try to log in 2 times after the exit (Prevent password error when the account lockout), time-out retry.The shell script calls and

Introduction to the Shell under Linux

?I. OverviewAfter the successful landing of Linux, the system will appear different cue symbols, such as $,~, #等, and then you can start to enter the required commands. If the command is correct, the system will be executed according to the

--shell Programming for Linux Programming (chapter II)

Chapter II Shell ProgrammingThe following sections are described in this chapter:What is a shell?Basic ideasSubtle syntax: variables, conditional judgments, and program controlCommand ListFunctionExecution of commands and commandsHere

Shell Monitoring Script 3

#!/bin/sh#count memory_used_rate,disk_used_rate # @yuanwb  2015-5  #disk_used_rate #depend  on real storage place the parameter  ' Location '  need to  Alter. location=/dev/sda1disk_used_rate1=$ (df -h | grep  $Location  | awk  ' {print $5} ') free1=

Shell Operation Memcache

[email protected] mc]# cat mc.sh#!/bin/bashfunction Random {mc0= "192.168.8.62 7510"#MC1 = "192.168.30.22 7510"Case "$ (expr $ (date +%s%n) \% 2)" in0)Mc= "$MC 0";;1)mc= "$MC 1";;Esac}> Set-result.txt> Get-result.txt> Delete-result.txtFor ((i=0;iDoa=

Single, multiple, and controlled process of the shell

Tag: Shell time expr wait Shell single, multi, control process use method one, 100 tasks using 200 seconds (normal completion) cat process2.sh #!/bin/bashfunction aaa  ()  {  start= ' date  "+%s"  for  ((i=1;iThis article is from the "7928217" blog,

Shell Scripting Learning

Shell Scripting Learning The shell is the command parser that converts the user-entered instruction into a program that the appropriate machine can run.The shell is a program that acts as an interface between a user and a Linux system, allowing the

Linux shell Programming

Linux shell Programming1) Write a script to complete the user input: 1. First name with 2. Last name, finally shipowner and displayed on the screen: Your full name is: content.1#!/bin/Bash2 #Program:3 # User inputs his first name and last name.

Shell script provides only integer arithmetic operations (three ways)-((expression)), let "expression", value= ' expr Expression Right ' (reprinted)

Transferred from: Http://blog.163.com/[email protected]/blog/static/132229655201131055455754/Numeric operations:Only integer arithmetic is provided in bash, and the shell is implemented by the two commands of Let and expr .Use the format: let "x=

Comparison of if condition strings in the shell

If condition judgment Comparison of Numbers-eq equals if [$a-eq 11]; Then commend Fi-GT Greater than -lt less than-ge greater than or equal to-lt less than or equal tostring comparison = = string comparison must have a space if [$a = ' yes ']

Shell calculation string length method and speed comparison

Tag: Shell calculates string length chars= ' seq-s '; echo $chars 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32  33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

Msfpayload Rebound Shell

1, Prophase--The situation is when we get Webshell, we want to leave our back door, this time we can use Msfpayload and msfconsole togetherStart PostgreSQL Service: Service PostgreSQL start start Metasploit Services: Service Metasploit start start

[Shell]bad substitution

There was a bug when I wrote a shell script recently#!/bin/shRight=disk1PART=${RIGHT//[A-ZA-Z]}Tips:Bad substitutionAt the command-line input, it is running correctly.Checked the next someone said to change SH to bash, found the problem solved.

Linux Learning Notes-The 12th lesson-shell Script's regular expression (i)

First, Grep,egrep,fgrep1) grepFormat: grep [options] [mode] [file name]Common options:-N: Display line numbers and matching rows-V: Reverse match-C: No matching rows are displayed, only the number of matching rows is displayed-I: Ignore case-R:

shell--Mathematical Calculation

The assignment and operation in the shell is the string processing by default, here are some special methods of mathematical operation in the shell, which can be seen later, hehe1. Examples of error methodsAVar=1+1Echo $varThe result of the output

Linux Shell Test

(EXPRESSION)Expression is true expression true! EXPRESSIONExpression is false expression falseExpression1-a EXPRESSION2Both EXPRESSION1 and EXPRESSION2 are true both trueExpression1-o EXPRESSION2Either EXPRESSION1 or EXPRESSION2 is true one of

Total Pages: 541 1 .... 249 250 251 252 253 .... 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.