1, the variable with = assigned value when the left cannot have spaces. For example , UserName =nihao returns userName: Command not found . Because this place username as a command to deal with. The right approach is to Username=nihao.Careful is the
grep is a powerful text-search tool that uses regular expressions to search for text and print matching lines grep [option] [mode] [file]-C #只输出匹配行的数量-I. #搜索时忽略大小写-H #查询多文件时不显示文件名-L #只列出符合匹配的文件名 instead of listing specific matching rows-N#列出所有的匹配行
Assuming this is the content of a script x.sh, use sh x.sh arg1 to execute the script#!/bin/bashCD ' DirName $ '/.SOURCE scripts/status.shStart [email protected]First line #! /bin/bash show where bash is usedThe code in the second line ' will be
Listen to people say that text classification when processing 100G text files, incredibly without big data, processing method is to use the shell split to split into a number of small files.Split commandNAME split-split a file into Piecessynopsis
1. pwdPWD: Displays the absolute path of the current directory2. cdCD Document: Go to subdirectory cd/usr/local/lib: Go to the specific directory CD.: Return to Parent directory CD/: Return root directory3. mkdirmkdir directory: Creating
The system is Ubuntu 14.04 64bit, previously wanted to install stream to play dota2, but eventually did not succeed. Because stream is only 32bit, a large number of 32bit libraries are installed when the stream is installed. Delete the stream, these
Today, to use the shell to do some auxiliary work, long time not to use, a little forgotten ...Here's a summary of today:1. If the brackets of the If judgment to leave enough spacesuch as if space [space content space];then........Fi2. The condition
The script is: nohup/mnt/nand3/h2000g >/dev/null 2>&1 & for & 1 more accurately said file descriptor 1, and 1 The general Representative is Stdout_fileno, which is actually a dup2 (2) call. He outputs the standard output to All_result, and then
The test command usage. Function: Check file and compare value 1) Judge the expression if test (expression is true) if test! expression is false test expression 1–a expression 22 expression is true test expression 1–o expression 22 expression has a
1. When defining variables, You cannot leave spaces on either side of the = sign.egGender=femal------------RightGender =femal-----------Wronggender= femal-----------Wrong2. Conditional test statement [the symbol is left blank on both sides .]egif
the Nginx service program written by Shell can be added to the/etc/init.d/directory first. chkconfig--add nginxd chkconfig nginxd on Service Nginxd Start Service Nginxd Stop service Nginxd "Restart | Reload | Test | Status " #!/bin/bash#chkconfig:-
Today learn bird's private dishes, according to the book hit a few shell script, but the total errorThe first is to use [] to determine the condition, = = does not work properlyThe second is to declare variables in the script to use declare, always
Setting environment variables#Set java_home=/root/deploy_ws/jre1.8.0#PATH = "$PATH:/home/user/bin"Calculate the length of a string#var = "12345"#echo ${#var}Shell currently in use#echo $SHELLQuerying the role of the current user#echo $UID//If root
The shell is an interpretive programming language.The execution of an interpreted script file:When an interpreted script file is executed, the script file is committed to the kernel. The kernel sees the first line of "#! "#! is called when the
A Brief History of Unix
UNIX was originally developed by the Computer Science Research Center of Bell Telephone Laborataries, the first version of which was born in 1970 – shortly after Bell Labs withdrew from the Multics project. Among the
How shell scripts run$sh script.sh$sh/home/path/script.sh$chmod a+x script.sh; $./script.shEcho's three ways to use echo Hello World Cannot contain some special keywords, such as semicolons;echo "Hello word" Cannot contain some special characters,
Java when invoking the shell, to continuously read the process of the standard output and error output stream information, or the buffer is full of the child process will be blocked and can not continue to run, up to two threads continuously read
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.