Several shell programming little knowledge (shell common sense part)

Reference: First, the user log into the system after the system environment variables: $HOME user's own directory $PATH directory to search for when executing commands $TZ Time Zone $MAILCHECK every few seconds to check for new letters $PS 1 The

Switch User Execute command method in Linux shell script __linux

Often when writing a shell script, you will encounter a different user to execute the relevant commands, the way to simply note: 1. Execute a single command: su-user-c "command" For example, the following command is to create a test123 directory

Java runtime.exec Execute shell command __java

Recently do a group purchase file download service, their lazy do not want to write the logic of the file download, and Linux Curl command is very powerful, so want to directly through the Java to execute Curl command to do the download. In Java,

There are four ways to do the Bash Shell's arithmetic operations.

No.1: Using expreg. R= ' Expr 4 + 5 'Echo $rNote : There should be a space between the operators and operands in the 4 + 5 expression # finally found the reason, to force Ah. In addition, for multiplication operator *, use expr needs to be added \

Shell's text processing-echo

one echo command output text 1.1 displaying normal strings echo [Options] string option means that the command option, only-n, does not output a newline character at the end of the line. If the text you want to output is made up of multiple

Shell writes CGI script

29th Chapter CGI Script This chapter contains content: Basic CGI Script Using server-side embedding (server Side Includes,ssi) Get method Post method Creating interactive scripts Ability to automatically reload Web pages with CGI scripts CGI is a

Shell script Kill (Kill) port number corresponding to the PID process

I use the Mac is when you start a Python port process, even if it is turned off, the background process is still present, the process of initiating the same port, or the error prompt has been occupiedWhen you lsof-i: the port number (linux--(SS-ANPT

Common standard input, standard output, and standard error redirection in shell scripts

1, you can consider/dev/null as a "black hole." It is very equivalent to a write-only file. All the content written to it is lost forever. and trying to read from it is nothing. However,/dev/null is very useful for command lines and scripts.  

Shell script Function Chapter

Words do not say much, directly on the format:function formats in the Linux shell:function Myfunc () {Action[Return int;]}Among them, the individual thinks function and () are all functions of the flag, if you do not need to pass parameters , choose

Access, deletion, substitution and substitution of shell variables

>Access to variables: EchoEcho $variableEcho $PATHEcho ${path}Configuration rules for variables1. Variables and variable contents are linked by an equal sign "=" as follows:"Myname=vbird"2. The equal sign cannot be directly connected to the space

Linux prints out the corresponding memory and sum (shell) for the selected application

while[1 ] Do Clear PSAux |grepXmirror |grep-VgrepMem=0 forDatainch`PSAux |grepxxxx |grep-Vgrep|awk '{print $4}'` DoMem=`Echo$mem + $data |BC ' Done Echo`Date+%f" "%h:%m:%S 'Echomem:{$mem} #if[$mem-GT2 ] if(Echo${MEM}2|awk '! ($1>

Script passing parameters to the Linux shell script

In the previous command Ls/var then in this command LS is the command keyword,/var is the parameter. So how do we do parameter passing when we're making a shell script ourselves?In bash, the first parameter is automatically placed in $ $, the second

Variable assignment for shell scripts

Parameter related knowledge${parameter:-word}: If parameter is empty or undefined, the variable is expanded to "word"; otherwise, the value of parameter is expanded; ${parameter:+word}: If parameter is empty or undefined, do nothing; otherwise,

exec parsing in shell

Reference: Linux commands, editor and Shell programming, advanced Programming for UNIX environmentsBoth exec and source belong to the Bash Internal command (builtins commands), where you can view all the internal command information by entering man

8.6-8.9 pipe and job control, shell variables, environment variables

8.6 Pipe break and job control pipe symbol "|" The effect of a pipe character is to drop the result preceding the symbol to the command following the symbol. Not all commands are available after the pipe character, and generally commands

Shell Learning Notes

Special variables$ A: The file name of the current script$num: Num is a number starting from 1, and $ is the first argument, and $ is the second argument, ${10} is the tenth argument$#: Number of arguments passed in the script$*: All positional

How to use the getopts of shell scripts

Encounter shell script need to collect parameter scene, with Getopts very convenientgetopts optstring name [arg ...] Example: Getopts "A:fs" OPTIONCommand Description:optstring lists all the parameters that the corresponding shell script can

Create a shell script for the android SD Boot Card

Create a shell script for the android SD Boot Card #! /Bin/bashexport lc_all = CIF [$ #-ne 1]; then Echo "Usage: $0 " Exit 1; fidrive = $1 skipmedia = 0out_ready = 0 root_dir = $ (PWD) product = 's5pc110 '# offset offset_authkey = 1offset_bl1 =

Shell basics 2: Search Skills, use of find and xargs

Shell basics 2: Search Skills, use of find and xargs Execute shell commands using exec or OK When using find, you only need to write the desired operation in a file, you can use exec to search with find, which

Powerful query character matching commands and shell scripts in Linux

Variable: Local variable: valid only for the current Environment variable: valid for both the current shell and sub-shell Export A = 3 define a as a variable and assign 3 to A = 3 Export a reference does not need to be added & Export also views

Total Pages: 541 1 .... 114 115 116 117 118 .... 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.