Simple example of a shell script

1. Analog Linnux Login Shell #/bin/bashEcho-n "Login:"Read nameEcho-n "Password:"Read passwdif [$name = "CHT"-a $passwd = "abc"];thenecho "The host and password is right!"else echo "Input is error!"Fi 2. Compare the size of two

Shell 10 Process Control

If is judged if#shell#!/bin/sha=5if [[ $a > 3 ]];then echo "$a>3"fi#写成一行if [[ $a 3";fi5>35>3If Else#shell#!/bin/sha=5if [[ $a > 8 ]];then echo "$a>8"else echo "$a5If elif Else#shell#!/bin/sha=5if [[ $a > 5 ]];then echo "$a>5"elif [ $a

Shell Script Connection Create database

1. Connect to create a database #!/bin/bashmysql="mysql -uroot -p111111"#sql="show tables from mysql"sql="create table test.user( id int unsigned auto_increment primary key, username varchar(20), password varchar(30))"$mysql -e "

Self-employed Linux system optimization shell (CENTOS6 64)

Optimized content includes kernel (commented out at the end of the article, see Personal needs) SSH time sync yum source#!/bin/bash#update Time 20180824#version 1.1.0Echo-e "\033[31m------------------------------Author name is Hefangyaonie-----------

Shell Programming-test Command (VI)

The test command is commonly used to check whether certain conditions are true.Numerical test-EQ: Detects whether two numbers are equal, equal returns True-ne: Detects whether two numbers are equal, not equal returns True-GT: Detects if the left

Operation of the Shell two ways

Interactive ShellPackage Mainimport ("Golang.org/x/crypto/ssh" "Log" "OS" "FMT"Func Main () {CE:= Func (err error, MSGstring) { ifErr! =Nil {log. Fatalf ("%s Error:%v", MSG, err)} } client, err:= ssh. Dial ("TCP","192.168.154.131:22",

Shell (3) application

Shell Script (iii)A For Loop statement: (Unknown number of cycles)For Variable name Value listDoCommand sequenceDone(1) Bulk add users by Name listVim/root/user.txt?ZhangsanWangwuXiaobaivim/root/uadd.sh#!/bin/bashulist=$ (Cat/root/user.txt)For uname

"Shell Scripting Learning-2"

#!/bin/bash-#echo do what exetuate this project \nprintf "Please input your passwd" Stty-echoread Pass 1.txt | Sort > 2.txt#echo "1 6 8 1 4 9" > 1.txt | Sort 1.txt | Tail 1.txt #cat/dev/null#!/bin/bash#cat/bin/liupeng | grep a | WC #$1#read $x

Shell Script (iii)

One? Using the FOR Loop statement(1) Structure of the FOR statement: When using a For loop statement, you need to specify a list of possible values for a variable, repeating the same sequence of commands for each different value until the value of

Shell Delimited string array

Tag:[1]    Array    shel   done   bash    str   class   lov   nbsp    #!/bin/bash tmp= "Test,girl,boy,love " old_ifs = " $IFS " ifs = " , " arr = ($a) IFS = " $OLD _ifs " Echo" arr[0] is: ${arr[0]} " echo "arr len: ${#arr [

Control Flow Structure in shell script

I am used to the C/C ++ programming environment, and then switched to shell programming, there is always a strange feeling. The general if-then-else Function Format in shell is as follows: If condition 1 Then command 1 Elif condition 2

Pass the array in the shell script to awk

If you encounter this problem, write it in your own way. Here, only the relevant part is shown. # Getting the length of an array Array_len = "'wc-l temp2 | awk '{print $1 }''" Temp_index = 0 Declare-A array_date # Assign values to arrays in

Peanut Shell domain name experiment [personal notes, for reference only]

1. Desktop (Wireless disabled, wired dialing) Bind the free oray domain name and the dial-up IP address (change the record ). 2. The oray client is updated in time, but the ping domain name times out. The reason is that the binding has not

Show your shell a bit of color

Reprinted please indicate the source: http://blog.csdn.net/lastsweetop/article/details/8908808 Author: Fire tianlin To avoid setting for each user, directly modify the/etc/profile file. 1. in Linux Add the following three lines: Give your ls a bit

) Simplified shell learning materials

1. system environment variables after the user logs on to the system: $ Home user's own directory $ Path: the directory to be searched during Command Execution $ TZ Time Zone $ Mailcheck the number of seconds to check whether a new letter exists

Seeking for OEP from shell-two memory breakpoint Methods

0x00 Preface The first thing for shelling is to find the OEP (oringinal entry point). Because of shelling, when the PE file is loaded into OD or other debugging software, it is usually the entry address of the shell program. So the first step of

How to compile Linux Shell script (1)

I am studying Linux Shell script recently.Linux Shell scripting tutorial (LSST) v1.05r3But because it is in English, it is also a deep impression. Now, go to the topic. 1. How to Write shell script? A. First, use any Compiler (Vi, Vim, kwrite,...)

Shell script if Parameter

[-A file] true if the file exists. [-B file] If the file exists and is a special block file, it is true. [-C file] If the file exists and is a special word file, it is true. [-D file] If the file exists and is a directory, it is true. [-E file] If

Tips for rebounding shell through webshell in Linux

13.2 tips for rebounding shell through webshell in Linux In Linux, webshell is used to reverse the reverse shell. The application in the Process of website server intrusion and Elevation of Privilege is wider and more frequent than in windows. The

Linux Shell script programming-Sort command

Sort The sort command sorts the rows in the file specified by the file parameter and writes the result to the standard output. If the file parameter specifies multiple files, the sort command connects these files and sorts them as one file. Sort

Total Pages: 541 1 .... 274 275 276 277 278 .... 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.