Small problems in Shell programming

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

Shell Programming---grep command

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#列出所有的匹配行

Learn Shell (1/5)

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

Split of shell command

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

Shell Common Commands

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

Linux shell in while with read from keyboard input

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

Numerical calculations in the shell

#!/bin/bashecho "Please input number:" Read na= ' expr $n/100 ' #a1 = ' expr $n-$a * b= ' echo ' ($n-$a *100)/10 "| BC ' c= ' echo ' ($n-$a *100-$b *10) "| BC '  d= ' echo ' $c *100+ $b *10+ $a "| BC ' echo $d turn:

Shell's If statement

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

Explanation of the meaning of "2>&1″" in the Linux shell script

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

Test command usage in shell syntax

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

Hadoop's--hbase shell command

Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46463503HBASE ShellEnter HABSE database terminal: # $HBASE _home/bin/hbase ShellCreate a table>create ' users ', ' user_id ', ' address ', ' info 'Table users, there are

Shell whitespace issues

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

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:-

Unbuntu Run a shell script problem

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

Basic shell command

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

Shell Script Programming Basics

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

Shell Review notes----Introductory knowledge

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

Shell Programming--shell Common commands

Browser tab switch: Ctrl+tabTerminalOpen Terminal Quick build: ctrl+alt+tClose Terminal shortcut key: Ctrl+shift+qOpen a new Terminal tab shortcut: Ctrl+shift+tClose the Terminal tab shortcut key: Ctrl+shift+wSwitch between terminal pages shortcut

Shell Script Basic Commands

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 calls shell Script blocking

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

Total Pages: 541 1 .... 317 318 319 320 321 .... 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.