Linux Shell Scripting Raiders Review

1. After opening the terminal prompt, $ represents a normal user, #表示管理员用户root, root is the most privileged user in the Linux system.2. A shell script is usually a text file with a #! start, where #! precedes the interpreter path. Example:

Shell Learning 17-shell for loop

Similar to other programming languages, the shell supports A for loop.The general format for A for loop is:For variable in list Docommand1command2...commandndoneA list is a sequence of values (numbers, strings, and so on), each separated by a space.

The use of sed in the shell

IntroductionSed is an online editor that processes a single line of content at a time. When processing, the currently processed rows are stored in a temporary buffer called pattern space, followed by the SED command to process the contents of the

Shell numerical calculation, fractional calculation

In a shell script, you can perform numerical calculations,如加减乘除,通过expr、let、(())等完成,文章介绍:http://blog.csdn.net/longshenlmj/article/details/14166193但是上面的运算只支持整数。小数计算怎么办?Shell small number calculationComplete with Bc,awk and Nawk tools, etc.The code for

Linux shell reads rows of files line by line

Read a file line For Command substitution Code block redirection While Pipe character Code block redirection ForIFS=$‘\n‘forin-l`do (( count++ ))doneecho$countNote:For read,

The assignment statement and Judgment statement in parentheses judgment in shell programming

#!/bin/bashdeclare var="XXX" #without space and use one =#1.judge Whether the assignment statement returns trueEcho"----------------------test Assignment in bracket--------------------------------"[var="yyyy"] && Echo"Success"Echo"End" #Success["$

Shell Bulk Replace content in text

Bulk Replace directory/proc in script file, for/ETC/INIT.D[Email protected] course_04]# more test.sh #!/bin/bashdir=/procaa= ' ls $DIR ' echo $aa650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/AD/wKiom1WktFCyF39TAAD5F48gmko076.jpg

Linux Shell Command Series (3)

bz2

One. Chown commandThe "chown" command changes the owner of the file and the user group. Each file belongs to one user group and one user. In your directory, use "Ls-l" and you will see something like this.[Email protected]:~# ls-lDrwxr-xr-x 3 server

Special variables in the shell

$ represents the current process when using the Echo $$ is the PID that will output the current shell1 Echo $$ List of special variables variables meaning $ File name of the current script

Use of variables in the shell

1. Declaration of variablesName= "Blacksonny" Note://variable definition does not add $, the variable and equal sign cannot have spaces betweenVariable naming rules: The first character must be a letter (a-z,a-z). You can use an

Shell type, version and selection

Shell type, version and selectionAnyone who uses *inx, whether as a loginThe shell is also programmed to touch the shell.After years ofDevelopment, a wide variety of shells. In addition to our familiar sh, ksh, CSH, bash ... , there are various free

The expression of the Linux shell

Strictly speaking, there is no concept of an expression in the shell. The shell itself is really just a collection of commands, and of course it is not a random heap, but a certain organization. But this organization is not so rigorous, so this

Synchronizing files remotely by using SCP or rsync in a shell script

The simple use of the remote SCP file shell expect is implemented in shell scripts with expect http://myunix.blog.51cto.com/191254/1095074http:// Jie-hui-520.blog.163.com/blog/static/60074301201022610217249/linux rsync Synchronous Practice Http://my.

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

Shell script to split nginx logs

#!/bin/bashLogs_path= "/opt/nginx/logs/"Pid_path= "/opt/nginx/logs/nginx.pid"MV ${logs_path}access.log ${logs_path}access_$ (date-d "Yesterday" + "%y%m%d"). LogKILL-USR1 ' Cat ${pid_path} 'Crontab-eXX * * * * sh/opt/shell/cutnginx.shThe script

Shell Script (vii)

Shell Script (vii)J, Array#关联数组: A generic array index must be a numeric value, and an associative array index can be a string#也可以是数值, similar to a Python dictionaryawk ' BEGIN {str[name]= ' string '; str[1]= "1"};p rintf ("%s\n%s\n", str[name],str[1

2.2-shell Array

A= (1 2 3 4 5) define an arrayecho $a show only 1 and cannot display all elements of the entire arrayecho ${a[@]} displays all elements of the entire array, and @ can also be written as *echo ${a[0]} displays only the first element in the array,

WIN8 installation of VISUALSVN Server service failure solution--peanut shell +VISIUALSVN to achieve extranet access to SVN in LAN (ii)

After an intranet implementation of the SVN extranet release, if you want to publish SVN to the external network, you must be on the local or server installed VISUALSVN server. In the process of practice, my SVN installation has been an error. The

Array of Shell scripts, shell scripts

Array of Shell scripts, shell scripts #! /Bin/bash # The operations on arrays in the shell that you must know. Arr = ("hello" "word" "you" "are" "a" "good" "boy") # arr = ('LS') # I like this method. Echo "------- for ----------------" for I in $ {

Solution: show only-bash-4.1 in shell command line # Do not show users and paths

Solution: show only-bash-4.1 in shell command line # Do not show users and pathsToday, I accidentally typed the home Directory deletion command. Although it was not deleted for various reasons, many files and directories in the home directory were

Total Pages: 541 1 .... 248 249 250 251 252 .... 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.