Leeboy's Linux learning fifteen shell conditional testing and simple conditional statement instances

1,Echo $?: An exit status is returned when any command is running, and the exit status of the previous command is output,0Indicates that the exit is successful. 2, Test File status:[-W text]Test whether the file can be written,Echo $?The output is0

Shell script syntax

Shell script:#! /Bin/Bash must pass the first line #! To specify the Current Shell I. variables:"": Allows you to reference values of other variables using the $ symbol.'': Other variables cannot be referenced. $ is considered as a normal

Redirection of input and output in Shell

/* Is also the online answer. I don't know where to find it ......*/   In the Linux Shell environment, input and output redirection is supported, expressed by symbols . 0, 1, and 2 indicate the standard input, standard output, and standard error

Powerful O & M shell commands

1. display the 10 processes that consume the most memory/CPU ps aux | sort -nk +4 | tailps aux | sort -nk +3 | tail 2. view the number of concurrent Apache requests and their TCP connection status netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S)

Clistctrlex: A list control that supports file drag and drop and real-time monitoring-real-time shell monitoring using undisclosed API functions

I. RequirementsWhenever you create, delete, or rename a folder/file in the Explorer window, or insert and remove a mobile storage, Windows can always update all its views very quickly. Sometimes our program also needs this feature so that our

Use shell to test the script or command driver.

#! /Bin/bash Compile = gccTest_filename = driver. cTest_filename_base =$ {test_filename % .*}Test_basename = test # Echo and run the specified commandEcho_and_run (){Echo $ @Eval $ @ If [$? -Ne 0]; thenExit 1Fi} ######################################

Batch pack IOS jailbreak packages by Shell

Often, a software IOS jailbreak package requires many channels. I used to modify the channel number once and re-package it. However, as more and more channel numbers become daunting, you can only find one automatic packaging statement. You can

Variable reference in Shell (two methods: $ variable name, $ {variable name }).

I. Basics We define a variable (there cannot be spaces on both sides of the equal sign) Filepath =/var/home/SSSFilefilename = test001 When referencing this variable, we can directly use the variable name following $. For example, $ filepathYou can

Dedecms get shell exp

Transferred from: t00lsExp, a vulnerability circulating on the internet, indicates that the backend can be used only if the plus directory exists and the server can be connected externally._ 1 U-T (B-F8 CPrerequisites: You must prepare your own Dede

Burpsuite cracking webshell password + domestic black wide shell password collection

Burpsuite cracking webshell password + domestic black wide shell password collection Burpsuite_pro_v1.3.03 download: http://h4ck3r.nbst.org/tool/burpsuite_pro_v1.3.03.zip Burpsuite requires Java support. Install the Java environment first. First,

Linux/Unix shell automatically sends AWR Report (2)

Observe the Oracle database performance. The AWR feature provided by Oracle provides us with a nearly perfect solution. With AWR features, we can extract AWR reports from the database at any time. However, we need to provide some interactive

Usage of various quotation marks in Shell

Go to: http://goward.jimdo.com/2010/06/15/linux-shell%E5%90%84%E7%A7%8D%E5%BC%95%E5%8F%B7%E7%9A%84%E7%94%A8%E6%B3%95/ The difference between these characters is how they affect variables (such as $ name) and shell commands (such as date ). For any

One pressure sink, renamed the ftp-uploaded Shell

# Ftp addressFtphost = "130.59.99.110"Username = "3weblogic1"Password = "3weblogic1" ./Exp_lanstop_remindGzip-F sig_conf_year.txtMdx = $ (csum sig_conf_year.txt.gz)# Echo $ mdxMD5 = 'echo "$ MDX" | awk-f''' {print $1 }''# Echo $ MD5Curdate = 'date +

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 =

Example of executing SQL in Shell

Dbstr = "Busi/xxxx @ CRM" Send_sms () {Pcount = 0For phone in $ phonelistDoTime = "inf" 'date + '% Y % m % d % H % m % s''Comm_sn = "$ {time} $1 $ {pcount }"Echo "comm_sn =$ {comm_sn }"SQL = "insert into Busi. log_sms_pay values ('"$ comm_sn"',

Output redirection in Linux Shell

In the Linux Shell environment, input and output redirection is supported, expressed by symbols . 0, 1, and 2RepresentStandard input, standard output, and standard errorInformation output. It can be used to specify the standard input or output to

Shell script memo

Common scripts in Linux include bash and shell. 1 #!/bin/bashecho "hello bash" #display one message Save the preceding content as a text file named me. The extension is arbitrary, but. Sh is often used as the extension. Run the command chmod A + x

Shell sorting of Reading Notes

Environment: [Lanux @ localhost -- debug --] $ uname-SRLinux 2.6.34.7-61. fc13.i686. PAE[Lanux @ localhost -- debug -- 15:32] $ rpm-Qa | grep anjutaAnjuta-doc-2.30.2.1-1.fc13.noarchAnjuta-2.30.2.1-1.fc13.i686Anjuta-devel-2.30.2.1-1.fc13.i686[Lanux @

Shell script notes

#! /Bin/sh# The first line is to tell the system who will execute this dumb. $ ## Number of parameters transferred to the script$ # ID of the current process during script running, often used as the suffix of temporary variables, such as haison. $$!

Linux shell commands

  Linux Shell is actually a command interpreter that explains the commands entered by users and sends them to the kernel. In addition, shell has its own programming language for editing commands. It allows users to write programs composed of shell

Total Pages: 541 1 .... 510 511 512 513 514 .... 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.