Linux note 3-11 3-12 shell script

# # 1. Create a new shell script  ##1. Create a text file that contains the bash command. The first line of the file should be:#!/bin/bash2. Make the file executable (using chmod +x scripts)3. script debug mode :#!/bin/bash-x# Bash-x Scripts# # 2.

The first lesson of shell script learning

The shell is a programming language and a service that accesses the operating system kernel.The types of shell that are common to Linux are:Bourne Shell (/usr/bin/sh or/bin/sh)Bourne Again Shell (/bin/bash)C Shell (/USR/BIN/CSH)K Shell (/usr/bin/ksh)

Linux shell Scripting--Using structured commands (iii)

for commandfor Var in listDoCommandsDoneCode 2-1[Email protected]:/data# cat demo1 #!/bin/bashfor test in Alabama Alaska Arizona Arkansas ' California Colorado ' do Echo "The next state is $test" Doneecho "The last state we visited be $test"

Write point shell--command line arguments every day

1, reading parameters: Positional parameter variable is the standard number: $ $ is the program name, "$" is the first parameter, and the second argument is ... 1 #!/bin/bash 2 # using one command line parameter 3 4 factorial=1 5 for

Shell if [-D filename]

[ -a file] is true if file exists. [ -b file] True if file exists and is a block special file. [ -c file] True if file exists and is a word special. [ -d file] True if file exists and is a directory. [ -e file] is true if file exists. [ -f file]

Linux Shell Multi-process concurrency and concurrency number control

1. Basic knowledge Preparation 1.1. Linux background processUNIX is a multitasking system that allows multiple users to run several programs at the same time. The Shell's metacharacters & provides a way to run programs in the background that do not

Ubuntu Shell Common Commands

This time used to liunx things, learning a write application, just beginning unfamiliar with liunx from the page to start using, later began to use the shell command to operate. First, record the command line used:I. File/folder Management LS lists

Explanation of the meaning of shell variable $#,$@,$0,$1,$2 in Linux

The meaning of shell variable $#,[email protected],$0,$1,$2 in Linux is explained:Variable 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)$- 

Play change volume, environment variables, and math operations (shell)

variables and environment variablesVar=value assigns a value to the variable, the output statement: $ echo $var or $ echo ${var}, remember that there is a space in the middleFor example: Name= "Coffee" age= "$echo" my name is : ${name}, The age is :

I/O redirection related in the Linux shell

1, the basic concept (this is the premise of understanding the knowledge behind, it must be understood)A, I/O redirection is usually related to FD, the Shell's FD is usually 10, namely 0~9;b, there are 3 commonly used FD, for0 (stdin, standard input)

Linux Shell Programming Example-get process ID

Today, I learned a little bit about the shell programming under Linux and simply recorded the test cases.1. Edit the shell script file as follows:#!/bin/bashecho "Hello Bash Linux"echo "No. 0 parameter: $ A"echo "First parameter: $ $"echo "Current

"Mkfifo" creates named pipes in the Shell to control concurrent execution of multiple processes

Background:Work there are two of remote computer room need to transmit data, data full name is standard, in a directory named Unified prefix plus number. such as/path/from/file. {1..100}. While the special line of the machine room is limited to the

Linux--note Shell common commands for cut, sort, unqi, tee, TR, split, and Shell Connectors && | |

1. CutUsed to segment a fileCut-d ' delimiter ' [-CF] n-d Specifies the delimiter followed by single quotation marks.-F Specify paragraph-C is followed by a number that indicates the intercept of the first few characters, followed by a number area,

. shell file permissions and script execution (change permissions)

Linux has three ways to change permissions:chmod/acl/sudo The first two are used to change file permissions,sudo is used for more application or command execution permissions chmod limitation is the inability to achieve multiple

[Shell advanced] The most bull B Linux shell command (iv)

1. View the ASCII code table Man 7 ASCII Many people are beginners to the concept of the ASCII code, and sometimes in order to check the ASCII value of a symbol, you may have to rummage to find the current textbook? Linux Manpage

Shell Step by Step (3)--stdin & If

4. Input and output#! /bin/bash# Read users input and then get his nameread"Please input your first name: " firstNameread"Please input your last name: " lastNameecho-e"Your full name is: $firstName $lastName"Read how to use:read[-ers][-a 数组][-d

Linxu Shell Iconv transcoding problem

First, view the file encoding. When you open the file, enter: Set fileencodingYou can display the file encoding format. Second, the file encoding conversion1, in vim Direct conversion file encoding, such as converting a file to Utf-8 formatin the

Recommend a chrome SSH plugin-Secure Shell

http://blog.csdn.net/jizhongchun/article/details/8519413Guide: I am a chrome Fans. Recently found a Google official out of the SSH plugin- Secure Shell ( The current version is 0.8.8). Over here.With:1 downloads.Download the extension to Google

Shell array: Definition of shell array, array length

The shell is much more programmatic in terms of programming than Windows batch processing, both in loops and operations.Bash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays.

The difference between the Shell scripting language and the compiled language

In general, the programming language can be divided into two categories: the compiled language and the interpreted language.Compiled languagesMany of the traditional programming languages, such as Fortran, Ada, Pascal, C, C + +, and Java, are

Total Pages: 541 1 .... 76 77 78 79 80 .... 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.