The reason why the shell variable assignment cannot have a space

Typical examples:A=dateEcho $a establishedA =dateecho $a not set upActually, the reason is simple.The principle of the shell in interpreting the command is that the first symbol tag can only be a program or a command, when there is a space, the

The difference between a single quotation mark, a double quotation mark, an inverse quotation mark ('), $ () in a Linux shell

One, single and double quotation marksFirst, both single and double quotes are meant to solve the problem of having spaces in the middle.The space is used as a typical delimiter in Linux, such as String1=this is a string, so execution will be an

Sed && awk tools and some common shell scripts

(i) SEDSed is a streamlined, non-interactive, streaming editor that enters edit commands and specifies file names on the command line, and then looks at the output on the screen.The content of a progressive read file is stored in a temporary buffer

[Shell] The shell often uses special symbols

Meet Meaning && Command1 && command2: Command 1 returns True (command return value $? = = 0) after which command 2 talent is run. Can be used for if inference.CP 1.txt.. /&& echo "succes" #-->successCP 1.txt.. /&& rm-f.

Several important shell commands: diff patch Tar find grep

Diff diir_1.0/dir_2.0/-urnb > dir_2.0.patchU:union output file differential information in a merged formatR: Recursive comparison of all files in subdirectoriesU: Treats non-existent files as empty filesB: Ignore the differences caused by empty rows~

"Linxu Learning 004" Bash Shell related

First, bash1.bash is also a program, when is the program called?User login, using the SU command to switch users, directly execute the BASH command will open a new bash, this shell called the child shell, the child shell can not be the same as the

Shell determines whether a file exists

Transferred from: http://www.cnblogs.com/sunyubo/archive/2011/10/17/2282047.html1. Shell to determine the file, whether the directory exists or has permissions2. #!/bin/sh3.4. Mypath= "/var/log/httpd/"5. myfile= "/var/log/httpd/access.log"6.7. # the-

Shell Basics and usage tips (Tools + Common bash commands to accelerate operations)

shell scripting Introduction and common Tools Shell Script Shell script: is actually a batch script in Windows, multiple shell command collections that can be executed at once. Scripts on Linux can be implemented in a number of

CRLF line terminators lead to Shell foot report error: Command not found

The line end flags for Linux and Windows text files are different. In Linux, the text file uses "/n" for carriage return, while Windows uses "/r/n" to indicate carriage return line breaks. Sometimes you need to be aware of this when writing shell

Shell Nginx Install + Load Balancer + Session hold

#!/bin/bash#by lc ip= ' ifconfig eth0|awk -f  ' [ :]+ '   ' NR==2{print $4} ' zhandian=/data01/static/shareextra=haixiang.conftoolsdir=/application/toolsnginxdir=/application/

Environment settings for the terminal of the Bash shell usage environment: stty

Environment settings for the terminal of the Bash shell usage environment: stty Environment settings for the terminal of the Bash shell usage environment: stty STTY-A Lists all the current stty parameters to INTR: Sending an interrupt

Shell script Programming: Conditional judgment if Statement usage summary

Shell scripting, there are three kinds of control structure are: sequential structure, conditional judgment structure, loop structure. This article summarizes the use of conditional judgment constructs in shell scripts.The structure of conditional

One: Shell Basics

1.shell OverviewThe shell is a command-line interpreter that provides the user with an interface system-level program that sends a request to the Linux kernel to run the program, and the user can start with the shell, suspend, stop, or even write

Linux gets time in the shell

Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day

The difference between $ (()) in the shell and $ () and ${}

$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.The so-called command substitution is similar to the variable substitution we learned in the fifth chapter, which is used to reorganize the command

Count rows in shell

Today I suddenly wondered how many lines of code I had written recently, and then I used the shell to figure out the most recent code: ? 1 Find/home/chengshuguang/mango-maxdepth 1-name ' *.c '-or-name ' *.cpp '-or-name ' *.h ' |

linux-"Linux command line and Shell script programming encyclopedia" read the notes

1. Core-Responsible key functionssystem memory management, software program management, hardware Device management, file system management2.GNU tool ChainThe Linux kernel is the core of the system, controlling how memory, programs, and hardware

Special usage of $0,$?,$! in shell

Special usage of $0,$?,$! in shellVariable 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 value)$-Flag at a glance using the SET command$*All

Shell script to delete the data table and empty the contents of the data table (save table structure)

A, delete all data tables for the specified database#!/bin/bash# Delete all tables in MySQL # example: # Usage:./Script user Password dbnane# Usage:./script User Password Dbnane server-ip# Usage:./script user Password Dbnane mysql.nixcraft.inch# ----

Linux-bash shell function; built-in command type

Command editing ability (history):One of the great features of Bash is that "he can remember the commands he used!" "This is a really great feature!" Because I just press "up and down" in the command column to find the front/rear input command! In

Total Pages: 541 1 .... 144 145 146 147 148 .... 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.