1.1-shell characteristics

!! Executes the previous command!cat executes the most recent command that starts with catCat!$ Execute command, above one command last parameter defines alias for parameter aliasUnalias aliases alias alias is valid only in the current environment,

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

1.4-shell Custom Variables

During script execution, if there are some commands or paths that are long and need to be used repeatedly. Variables are used instead, which makes it easy to change and maintain.Read-t3-p "Please input a number:" NEcho $nRead is commonly used to

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

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

Strings can be in single or double quotes, or without quotation marks.Single quotation marksstr='This isa string'Single-Quote String restrictions:1. Any character in a single quotation mark is output as is, and the variable in the single-quote

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 Programming Notes

1.Bash variablesUser-defined variables #局部变量environment variable #全局变量Positional parameter variablesPre-defined variablesX=val #赋值$x #调用Variable defaults to character type and cannot be directly calculated"$x" ${x} variable overlay, that is, the

The shell determines whether the condition exists

1. 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-x parameter here determines whether the $mypath exists and has executable

"Linux-shell" shell script basic grammar Exercises

has been learning, but also has been forgotten, today with the help of this blog post, to record their own learning process some of the most basic things!1. For#!/bin/bashfor i in {1..10}do echo $idoneScan the active IP in the target network segment#

Shell Scripting Exercises

Write a small script to calculate how many days you have for your birthday.#!/bin/bash#  Enter your birthday date, calculate how many days you have birthday # 2015 July 20 read -p   "Please enter your birthday date (YYYYMMDD): "  date1date_d=$ (echo 

Considerations for writing shell scripts in Linux

The operation of commands is analyzed and run from top to bottom, from left to right. The order is released as mentioned in the fifth chapter: multiple blanks between commands, options, and parameters are ignored; Blank lines are also

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

Transferred from: http://blog.sina.com.cn/s/blog_464f6dba0100psy9.htmlVariable 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

Shell Script Pass Parameter

wrote a script to automatically generate PDF uploads GitHub can't stand every time the same commit decides to use a script to pass the argumentSimple and easy to use bold method, more complex can refer to the following two detailed.How to pass

Shell utility features (summary)

1. Command history:By pressing the UP ARROW key, you can traverse backward through the most recently entered command under the console, and by pressing the DOWN ARROW key, you can traverse the command you recently entered under the console.You can

Shell Basics 20 Some notes

Shell Basics 20 ArticlesTransfer from http://bbs.chinaunix.net/thread-452942-1-1.htmlDiscussion: Bash built-in command readRead-p "How old r u?"Echo $ageRead-p "Some words?"-a wordsEcho ${words[*]}Read-p "Password:"-S passwdEcho $passwdRead-t 5

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

Manual stripping Kbys Packer (0.28) shell combat--my love crack training First class elective assignment five

Fly2015I love cracking training first elective homework 5 practice procedures, in the company when using the tulip OD Debugging the shell program when there is a problem, but home with my love cracked version of od a debugging, all body spirit cool,

Special variable IFS in shell

Special variable IFS in shell As I get used to the writing style of python, I often want to use bash to traverse the lines of a file and process the lines read. But in a strange situation, if my text is similar to this The first line.The second

Shell-automatically deploy war packages to tomcat and shell-tomcat

Shell-automatically deploy war packages to tomcat and shell-tomcat#! /Bin/shCURL = $1CRootDir =/data/tomcat-usercenterShRootDir =/data/tomcat/dll# Delete old versionRm-rf $ shRootDir/usercenter-web.war *# The default war package address is the last

Total Pages: 541 1 .... 477 478 479 480 481 .... 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.