Linux Shell Programming Basics First, Shell introduction

Shell Introduction The shell is in the outer layer of the kernel, which is responsible for receiving commands entered by the user, then interprets the command as kernel can understand it, then executes it by kernel, and returns the result back to

Shell Primer Basics

1. Build and run the shell program What is a shell program? Simply put, a shell program is one that contains several lines File for Shell or Linux commands. As with programs written in high-level languages, writing a shell program requires a text

Shell sh update CSS picture version

#!/bin/bash csstmpl_path= "/home/fdipzone/php/csstmpl" css_path= "/home/fdipzone/php/css" replacetags= (". png") ". jpg" ". gif") convertnum=0 search_child=$1 echo ${search_child:=0} >/dev/null function Create () {tmplfile=$1 dfile=$2 css_content=$

Linux/unix shell arguments to SQL scripts

In the process of database operation, the Shell script provides great convenience for operation and maintenance. A shell script parameter passed as a variable to SQL and a SQL script is one of the scenarios that DBAs often encounter. This article

Shell condition test Statement, String test whether Apache is open

It took me 10 minutes to figure it out. = "and"-N "usage differences, make a note to smooth First method: Test if Apache is turned on? String test #!/bin/bash web= '/usr/bin/pgrep httpd ' If [-N "$web"]; $web whether the return value is empty

How to generate a server password from a shell script

Write a script that can generate random passwords, if you want pure numbers or only letters or case, can be customized, I write a full element here. #!/bin/bash # Author:honway.liu # date:2013-07-19 # concate:gm100861@gmail.com len=90 str= (a B C

Shell extensions: Customizing context Menus

If you need to get the full path of a selected file, little brother often mechanically copied the path in the shell window, then copied the file name and spelled it after the path. Sometimes the file path is copied for use by the program, which

Test statement format for Linux shell scripts

In the shell script to do a variety of tests frequently, test the format of the statement: (1) Test (2) [ (3) [[ Three kinds of differences, in the third can be a wildcard matching, and &&,| |,, the operator can also be normal presence in [[]],

Brief description of Linux shell environment and shell script

1. "" "" "The Difference," "The variables will be resolved" "All of them as strings" "to execute system commands 2. The custom variable defaults to a local variable, and the environment variable is a global variable. 3.export can set one or more

Shell account Management: User and Group management

1.Linux users are divided into ordinary user accounts and Superuser user accounts. The 2.Linux group accounts are divided into private groups and standard groups. When you create a new user, but do not specify the group to which he belongs,

Comparison of if judgments of the shell

The IF function in the shell is beyond doubt that every 80% of the shells will be applied to if judgment, then as a novice I should be the whole, I heard a morning class today, and then the morning's things summed up a script, and then to the people

The iptables of the shell

ack

These five positions are also known as five hooks (hook functions), also called Five rule chains.1.PREROUTING (before routing)2.INPUT (packet inflow port)3.FORWARD (forward tube card)4.OUTPUT (Packet egress)5.POSTROUTING (after routing)This is the

3. Self-learning Linux road: Shell feature three: command history

Command historySummary: Bash holds a list of commands that have been executed in the past.The command process for the current shell is saved in memory.When you exit, save the hidden folder to the current User folder. Bash_histroy, ls-a can

Shell--read-u

Transferred from: https://zhidao.baidu.com/question/357781350.html while Read-u3 i && Read-u4 J; Do Echo done34Read-u3 I means to read a row of data in the I variable from FD # 3rd (file descriptor, filename descriptor), so you know what Read-u4 J

Shell--wait and multi-process concurrency

Open multiple sub-processes in the script with & background, and use the wait command to make these sub-processes execute in parallel.Example 1:fun1 () {whiletruedoesecho1sleep1done }fun2 () {whiletruedoecho2sleep 1 Done &&WaitExample

Shell's recommendations

Specify bashShell script first line, #! What should it be?Most of the cases/usr/bin/env bash,/bin/bash,/usr/bin/bash,/bin/sh,/usr/bin/env sh are equivalent, but few cases still have pits. If the default shell may not be bash, such as a release law,

Shell Programming for Loop

1. Grammatical structure2. Case studies2.1 Batch Decompression#!/bin/bashcd/root/test/ls *.tar.gz > Ls.logls *.tgz >> ls.logfor i in $ (cat ls.log) do tar-zxf $i &A mp;>/dev/null donerm-rf ls.log~

Common Shell Routines

1. Iterate over each line in the file while read line; Do Echo $line; Done file. txtOrCat file. txt | ( while read line; Do echo $line; done)OrCat file awk ' {print} '2. Iterate over a word for inch $line; Do Echo $word; Done3. WC statistics

Array base syntax in shell

Basic assignment of an array Arr= (a b C) Arr[index]=a 2. Two common methods Str=${arr[@]} (array converted to string) len=${#arr [*]} (array length) 3. Ways to

Several common sorting algorithms (bubble, select, insert, Shell, continued)

Take a look at several common sorting algorithms in the next two days.1. Bubble Sort MethodEach time the adjacent elements are compared from i=0, if arr[i]>arr[i+1], they are exchanged. Until the biggest element is pushed to the end. Go back to i=0

Total Pages: 541 1 .... 454 455 456 457 458 .... 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.