Shell script implementation polling to see if the process is over

Functional Requirements:A shell script, in order to use a multi-process, to start more than 10 background running programs, in order to prevent the script than the background process prematurely end caused unpredictable impact, now to determine

The IF variable in the shell contains a string in the judgment

Reference:Http://bbs.chinaunix.net/thread-1633281-1-1.htmlDemand:The "/data/cache" string is sufficient in the cache_dir of the judging variableAct 1:if [["${cache_dir}" =~ "/data/cache"]; Then echo "true" fiAct 2:if [[${cache_dir} = */data/cache*]];

Run scripts in different ways in the shell

In the shell, you can run the script in 3 ways:1. ./script_name or source./script_name2 Direct./script_name3./script_name &Join script Script_name There are two command command1,command2, then, when run in the first way, Command1 and Command2 both

The type command in the shell

Type [-AFTPP] name [name,...]-A prints all possible cases of name, such as Type-a ls, which will print LS is aliased to ' ls--color=auto ' and LS is/bin/ls-F does not go to find function-T Print alias,keyword,function,built-in,file these 5 types-P

Shell One-click View Linux hardware configuration

I took over two projects, suddenly the eldest brother asked me what configuration of the server, then I was ignorant, has not been too concerned about this thing, just to ensure that the server normal operation, the site can access normal, the other

Execution flow of commands in the shell

In the shell, a command is written in 3:1 can write directly (Normal Command)2 can be placed in double quotation marks ("Command")3 can be placed in single quotes (' Comand ')In this 3, the execution flow of the command is not the same, as shown

Shell file Self-write

time=$ (date +%y%m%d)             mkdir $ time               cd  $time      touch 0.txt touch 0.ctouch 0.cctouch 0.cpptouch 0. htouch makefiletouch 0.sh   echo  "#include "  >> 0. cecho  "#include "  >>0.cecho  "Void fun ()"  >> 0.cecho   "{"

[Shell Foundation]--paste Command

The test text content is as follows:# cat Name1.txt name1 alvin1name2 alvin2name3 alvin3name4 alvin4# cat name2.txt name1 100name2 101name3 102CCCCCCCCCCCCCCC C(1) Paste merge each line of two files by one by one# paste Name1.txt name2.txtname1

Shell Set Understanding

In the load-spark-env.sh script below the spark bin , there are the following statements: If [-F "${user_conf_dir}/spark-env.sh"]; Then # Promote all variable declarations to environment (exported) variables set-a . "${user_conf_dir}/spark-

Shell condition Test

The shell condition test can be done in two ways:Test parameters Testing Content[Parameter test content]First, test file type:TEST-E file name (test file exists)[-e FileName] Test file exists, note the space on both sides of the bracketTest-f file

The shell of HDFs

The call file system (FS) shell command should use the form $HADOOP _home/bin/hadoop FS.All FS shell commands use the URI path as the parameter.The URI format is Scheme://authority/path.The scheme for Hdfs,hdfs is HDFs, such as Hdfs://localhost:9000/

Shell of Linux Basics (1)

The shell acts as an interface between the user and the kernel in the Linux system, which is used to convert the commands entered by the user into instructions that the kernel can understand, and then to perform the corresponding functions through

Linux Shell Basic Command

Learning basic Linux Commands Command Description $ ls This command was used to check the contents ofThe directory. $ pwd This command was used to check the presentWorking directory.

Shell Simple Usage Notes

One, the main use of the Bash Shell in Linux; View the supported shell types available on Linux systems :Vim/etc/shellThe way to perform shel footsteps:1. Give footsteps the ability to execute permissions and invoke the script using a relative or

Shell quickly migrates massive files

Business requirements: the need to migrate 1000多万个 files from one directory to a remote machineIdea: Use wget to move the file one after another, because the number of files is relatively large, if a bit in the loop operation, it will be very slow.

Linux----->shell Advanced programming----SED applications

backgroundsed is a good file processing tool, itself is a pipeline command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work.SED is intended to be a stream editor (Streameditor)

Shell contains all the decompressed functions

bz2

#!/bin/sh ()  {        if [ -f $1 ];then                 case $1 in                    *.TAR.BZ2)       tar xjf $1       ;;                          *.tar.gz)        tar xzf $1       ;;                    *.BZ2)           bunzip2  $1      ;;         

Shell---grep command detailed

First, grep ----"Line filter Tool" grep (Global search Regular expression (RE) and print out of the line, fully search regular expressions and Printing a line is a powerful text-search tool that can use regular expressions to search for text,

The grep tool under the shell

One. grepgrep (Globally search a Regular Expression and Print) is a powerful text search tool , it can use regular expressions to search for text, print matching rows, but does not affect the contents of the original file , and by the return value

4.7 Hill (Shell) sorting method

4-7 shellsort.c1#include 2#include"4-1 createdata.c" //function to generate random numbers3 #defineArraylen 10//number of data elements that need to be sorted4 voidShellsort (intA[],intN//Hill Sort5 {6 intd,i,j,x;7d=n/2;8

Total Pages: 541 1 .... 531 532 533 534 535 .... 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.