Shell Script Programming Basics

1. Create shell script file     Create file, add executable permission to file chmod +x file    format: Specify the shell        #! in the first line of the file /bin/bash    NOTES: #开头的命令 (except  #!/bin/bash  in the first line)     Display message:

Shell Script Case Analysis

#!/bin/sh### globalsimg_ext= "{png,jpg,gif}" sql_file= "My_images_mysql.sql" sql_ins= "INSERT INTO  images values  ("Sql_imageid_range=0sql_imagetype=1sql_name=" "sql_image=" "### ERRORNORMAL=0ERR_ Args=1err_no_dir=2err_no_file=3retval= $NORMAL #####

Shell script programming string testing and looping

== : Two strings are equal! =: Two characters not equal> : Whether a string is greater than another string : Whether a string is less than another string- N String : Tests whether the specified string is empty- s string : Tests whether the

Shell script Programming {3} per day

Use of arrays$array _var= (1 2 3)--use parentheses to define an array with a column value$echo ${array_var[0]}--The first element of an array$array _var[0]= "Zero"--defines an array using the form of an index and a value$echo ${array_var[@]}--Print

Conditional test in Shell

Condition test Type in Bash script: integer testString testFile testExpressions for conditional tests: [Expression][[expression]] expression must have a space before and after itinteger test :-eq: Tests whether two integers are equal and equal to

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

When the shell script executes, passes parameters to the script

Shell scripts can also receive script parameters, like commands and applications, as they are executed .An application example:VI addhead.sh:Suaddhead ns=591 $Perform:./addhead.sh Rtm_step10_lap.dat rtm_step10_lap.su (where rtm_step10_lap.dat is

Shell Test Command

The test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file. Numerical test Parameters Description -eq Equals is True

Shell Script Summary 2

Echo ' seq-s ' 10 '--command to use anti-quoteecho $ (seq-s "" 10)(())LetExprBC--Features support for fractional counting$[]----------[Email protected] ~]# ((ruan=1*8-9))[Email protected] ~]# echo $ruan-1---------[Email protected] ~]# b=$

Shell command (ii) The art of Rsync

(1) rsync (remote synchronize) is a data synchronization tool that allows you to quickly sync files between multiple hosts via Lan/wan, or use rsync to synchronize different directories on your local hard drive. (2) Rsync is a tool for replacing

Some points to note about the function of shell programming

This morning a friend suddenly QQ asked, shell programming function why return can only be an integer, how to return the execution of the function and save to a variable. In fact, this problem is very good to solve---only need to seriously

Shell Foundation-environment variable configuration file

Shell Foundation-environment variable configuration fileSource configuration file or. Configuration file:After the environment variable is written to the configuration file, the user needs to re-login to take effect, but with the source command, it

Shell Tutorial One: string manipulation

One: Linux shell string interception and splicingSuppose there is a variable var=http://www.linuxidc.com/123.htm 1 # Intercept, delete the left character, and leave the right character.  Echo ${var#*//}where Var is the variable name and the # is an

X-shell Key Login Method collation

1. First, log on to the remote Linux server, such as 192.168.127.222, with the normal password login method;2. Click the Key Generation Wizard in the tool:650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/67/wKioL1YcmyPy22e-AAI3RPggo2A573

[Reprint] "Shell script" line-by-row processing of text files

Transfer from http://www.cnblogs.com/dwdxdy/archive/2012/07/25/2608816.htmlThe style files are often processed on a line-by-row basis, how to get each row of data in the shell, then process the row data, and finally read the next row of data, loop

Linux Shell SSH Login Script

Linux Login Server Knock command too much, at some point it is inconvenient, so the shell wrote aI. Description Supports both secret and key formats The user name and password are both written and saved in clear text Two. Configuration

Simple usage of shell functions

FunctionFunctions have the same functionality:Simply put, the function of the program is to call the same part of the code in a number of parts, and then a name, so the function is called the name can be, in the modification of the code, only need

Shell Basic Features 2

                          Bash of the Base Infrastructure Special Sex21. provides a programming environment Program: Instruction + data program programming Style: Process: command-centric, data-serving instruction; Object type: Data-centric,

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

[9-13] Shell Series 8--Arrays

This article is intended to review the definition and assignment of arrays in shell script programming, to read arrays, and to get the length of an arrayKnowledge Reserve Array : Multiple contiguous separate memory spaces, each memory

Total Pages: 541 1 .... 313 314 315 316 317 .... 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.