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
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*]];
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
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
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
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
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
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-
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 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/
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
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.
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
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.
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)
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,
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 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
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.