Shell Programming Learning

1.Shell programming As with Java, PHP programming, as long as there is a code to write a text editor and a can explain the execution of the script interpreter can be#!/bin/sh (#! tells the system that the program specified after the path is the

Shell performs FTP action and log merge

First, FTP download the current file according to the date#!/bin/bashdate= ' Date +%y%m%d ' ftp-n Second, upload the current file according to the log#!/bin/bashdate= ' Date +%y%m%d ' ftp-n Three, more and catalog upload download#!/bin/bashdate= '

Linux Shell Script Raiders 001

Shell scripts are usually text files that start with #!/bin/bash. #! is placed before the interpreter path.Use bash as the interpreter to interpret all command-line commands.There are two ways to run a script, one is to use the script as a

Shell Script Implementation command line multilevel menu (no specific function)

#!/bin/bash#auth chentp0601#date 20151123Function menu (){ClearCat #this is Base menu1.[install Lamp]2.[install LNMP]3.[exit]EofRead-p "Please input 1-3:" ListCase $list in"1")While TrueDoMenu_lampDone;;"2")While TrueDoMenu_lnmpDone;;"3")Echo-e

Lao Li share: "Linux shell Script Raiders" Essentials (VI)

1. Print network interface list [[email protected] touch_more]# Ifconfig | cut-c-10 | Tr-d ' | Tr-s ' \ n 'Eth0lo//cut-c-10;      Outputs the first 10 characters;//tr-d ";     Remove all spaces;//tr-s ' \ n '; Compress duplicate newline characters 2,

Shell Primer-awk-1

The advantage of awk for sed grep is segmentation, dividing the delimiter into a small segment, matching, replacing, manipulating, logical judging, comparing ... such asBasic operations of AWK[[email protected] ~]# awk-f ': ' {print $} ' 1.txt////-F

Shell Getting Started-variables

Shell variables are divided into system variables and user-defined variablescommands to view variables#env System VariablesOr #set include env and custom variables and extra variablesThe command to use the variable is#echo $ "Variable"///////////////

Shell three execution modes (simple parameter description)

ShellThree ways to do it (not original, forget who's blog) 1: . Filename 1. SOURCE command usage: source FileNameFunction: Reads and executes the commands in the filename under the current bash environment. The filename file can have no "execute

Linux notes: Shell basics and Bash's basic features

Shell's advantage: You can call Linux system commands directlyBasic syntax for shell scripts:Script name ends with. shThe first action of the program #!/bin/bash, tell the system this is a shell scriptWith # as a commentHow shell scripts are

How to test the correctness of shell scripts

In the actual work, the shell script needs to be tested for correctness.How to test in the quickest and most effective way?A lot of development habits are, apart, write/Get, run a, see input, output, want to do the operation is completed, also

The Shell gets the Linux server's MAC (generic, does not depend on the NIC name)

Sometimes the server vendors will make their own naming rules, such as some of Dell's server network card name may be the beginning of EM, such as EM1, and sometimes the beginning of the ETH, such as eth0, which let us get the network card command

Getting Started with Shell awk

AWK: useful Data processing toolsAwk is also a great data-processing tool! SED is often used for the processing of an entire row, and awk prefers to divide a row into several "columns" ( or, in other words, a column) to handle. Thus, awk is quite

Shell's common commands for work

1. grep====================== from Shell script Raiders ================================= Search from file or standard input. -E (E) (equivalent to egrep ) + "Regular expression" + files - o (Output matching text only, can be used

Shell Daily Case (i)

 Orderdeveloped under the Linux platform, we are often exposed to tasks of the nature of the work, and the processing methods are diversified. Now accumulate each case. Cleaning up the data log files for nearly 7 days is getting bigger, and we need

Three: Shell operators

1:declare commandshell Default is String typeIf subtraction is required, it needs to be defined as an integral typeDECLARE command: Change the default variable type Decalre [+/-] [option] Variable name-set type properties for variables+ Cancel

Shell Common Command Summary

Shell Common Command Summary1 ls command: List filesLs-la list all files and folders in the current directoryLS A * lists all files starting with the A letter in the current directory Ls-l *.txt Lists all files with the suffix txt in the current

Bash Shell Foundation II conditional judgment

if condition judgment; ThenStatmentElseStatmentFiOrif condition judgment; ThenStatmentElifStatmentFiAnti-quote: Returns the execution result of the command to the variable.Set UserIDUserID = ' Id-u user1 'command to end a script prematurely: exit:

Shell-Judgment statement

The process controls the "if" expression if the condition is true then the following part is executed: if ...; Then....Elif ...; Then....Else....FiIn most cases, you can use test commands to test the condition.   For example, you can compare strings,

A simple script that automatically creates shell scripts

Because I usually write some small experimental script, every time to write author,description and so very troublesome, then wrote such a script can create their own small script, code as follows, pure personal original, relatively rough, big God

Data structure and algorithms--Hill sort (shell sort)

Hill sort (Shell sort)#include using namespace Std;void print (int a[], int n, int i){Coutfor (int j= 0; j{COUT}cout}/* Direct insertion of the general form of the sort ** d Zoom out increment, if is direct insert sort, d=1 */void Shellinsertsort

Total Pages: 541 1 .... 470 471 472 473 474 .... 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.