Shell files exist in the judgment shell array

Judgment file:Workdir=/home/tmplocal_list_file= $WORKDIR/local.list#if no Local.txt file, generate a new oneif [!-F "$LOCAL _list_file"]; ThenTouch $LOCAL _list_fileFiNote: Be sure to have a space, to determine whether the file exists, if it does

Linux Shell string Intercept __linux

Linux Shell string interception is useful, there are eight ways: Assuming there are variable var=http://www.aaa.com/123.htm 1. # Intercept, delete left character, keep right character. Echo ${var#*//} where Var is the variable name, # is the

How the shell uses an array as a function parameter __ function

Because of the need to use the shell to develop a number of gadgets, when using an array as a function parameter, found that only the first element of the array can be passed, the elements behind the array can not be passed into the function.

Linux shell time operation and calculation method __linux

 In recent time, when dealing with shell scripts, encountered time processing problems. The addition and subtraction of time, as well as the calculation of timing. 1. Time plus minus The way to do this is to turn the base time into a timestamp,

Java executes a problem with a redirect or Pipe shell command __java

The Java Execution Shell command has not been used before, and it is thought to be as convenient as C, and can be done with a system function. It's not that much of a problem today. There are two ways of executing shell commands in Java: 1. Use of

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

System () Execute shell command

Implementation Principle Strace Tracking Results: Clone (Child_stack=0, flags=clone_parent_settid| SIGCHLD, parent_tidptr=0x7fff936fc388) = 15661 wait4 (15661, [{wifexited (s) && wexitstatus (s) = 0}], 0, NULL ) = 15661The actual process: 1.

Socket Programming Example: TCP Shell back door __ Programming

Source: This article originates from: http://sinbad.zhoubin.com Author: Unknown (2002-12-12-06:02:00) Simple and easy to find, and learn it as a socket programming example. /**/ /*======================================================================

Shell script variables and parameters

The variables are divided into three types:1, ordinary variableis the local variable. Variable is the variable name Variable=value//= the left and right sides can not have spaces, otherwise it will be treated as commands, output a command not

Linux shell pushd popd dirs Command __linux

Http://www.cnblogs.com/davidwang456/p/3784102.html http://blog.csdn.net/yucan1001/article/details/8455757 http://blog.163.com/yangfan876@126/blog/static/806124562013720104712282/ 1, dirs1) functionDisplays all records in the current directory

Let the echo output in the shell script be colored

There are two ways to let echo output a color 1. Define the color variable in the shell script and use ECHO-E to invoke the variable 2. When defining variables, define the ECHO-E into a variable, and then output the variable Shell script that allows

The meaning of $, $, $!, etc. in shell scripts.

Recently learning a Linux script, here is the meaning of $, $, $!, etc. in shell scripts Variable Description $$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return

Shell View process Status--ps command

Http://www.cnblogs.com/wangkangluo1/archive/2011/09/23/2185938.html Name: PSUsage rights: All usersHow to use: PS [options] [--help]Description: Shows the dynamics of the instantaneous stroke (process)Parameters: The parameters of PS are very many,

Rsync error capture shell capture return code

Because of the job needs, because to determine whether rsync is successful, at first I was to judge the local file there is no to that do quiteSafety, now to push the data past, I can not judge, only with the rsyncreturnIn the first place, the '

Bash Shell recursively implements file copy in directory

PrefaceThere is a problem with working today, if you copy the file in directory A to directory B (without the file in directory B), and keep the file structure in directory A. The project focuses on the following: You need to keep the structure of

Essay 1:shell recursively traverse a folder

Recently work required, wrote some shell scripts to do server one-click Package Update, Traversing a folder with a for recursion contains spaces in the file name, which is treated as two files Workaround: Modify the delimited IFS #! /bin/bash

The shell gets the names of all the folders under the directory and outputs

Gets the names of all the folders under the specified directory/usr/and outputs: Shell code: 1 #!/bin/bash 2 #方法一 3 dir=$ (ls-l/usr/|awk '/^d/{print $NF} ') 4 for I in $dir 5 do 6 echo $i 7 done 8 ####### 9 #方法二 -dir in $ (ls/usr/)

A loop-renamed Shell

#!/bin/bash db_ip= Db_user= Db_passwd= Db_name= a=98000000 function Addsql () { Ine2=$1 Ine3=$2 #sql1 = "Update table name set list = ${ine2} where id= ${ine3};"; sql1= "Update table name set sex=0 where id= ${ine3};"; echo $sql 1 Mysql-u $DB

Shell Scripting Learning Notes (advanced usage of SED----mode space and hold space)

Some time ago in the study shell script, the last mention of the SED mode space and maintain the concept of space, but has not studied well, these two days studied, so it sent, not very comprehensive, just for your reference. Keep the space sed

Linux--shell Script Basics (variable types, variable operations, definitions, operations and logical relationships)

Shell Script Basics1.变量什么是变量#a=1# echo $a1变量:可以变化的量 1.2 Variable name considerations变量名不能以数字开头不能与系统中已有的环境变量重名,尽量不要全部使用大写,尽量不要使用“_”下划线开头最好做到见名知意不能使用程序中的保留字,列如if,for等 1.3 Variable types Character type Numeric typeIntegral

Total Pages: 541 1 .... 208 209 210 211 212 .... 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.