This article mainly introduces the Linux Shell Script series (i): Introduction to the shell, this article explains the shell introduction, Shell basic operations, how to open the shell terminal, Shell script concept, how to run shell script, shell
What is the Classic shell?
The Classic shell is a Windows Start Menu tool that offers three start menu styles such as XP classic style, Vista double bar classic style, Win7 two-column evolutionary style, and replaces your favorite "Start" button
Special characters in the Shell have
1, $ dollar character2, reverse Slash3, ' inverted quotation mark4, "double quotes5, ;,*,?, [,]
Let me make a list of the following
One, $ symbol
1, echo $? The previous instruction exit status is displayed2,
Concept
SSH means that the secure SHELL,SSH protocol family is developed by the network Working Group of the IETF (Internet Engineering Task Force), The content SSH protocol of SSH Protocol is a security protocol based on application layer and
The method of random number provided by C Srand and Rand, the former is to give the latter set of random number seed seeds.
int rnd_num = 0;
Srand (seed); Time (NULL) usually used to make seeds
Rnd_num = rand (); Generate random numbers
Methods
if logic judgment in shell scripts
Logical judgment Expression:
-GT (>); Greater than great than
-lt (=); Greater than or equal to
-le (
If logical judgment format:
Format 1:if condition; Then statement; Fi
format 2:if condition; then
This article will cover the most common tools used by Linux to process text using the shell: Find, grep, Xargs, Sort, uniq, tr, cut, paste, WC, sed, awk, and the examples and parameters provided are the most common and practical. The principle I use
There is an interesting question today:A group of friends wrote with a shell:#!/bin/bash# hundred million chicken, each chicken at least buy one all= -# Cocks per how many yuan read-P'Rooster How many text one:'gongji# hen per how many yuan
Foreword: It is difficult to write all the code in sequential order when it is hard to satisfy the requirements when facing various lists and repeating tasks. Use other program control structures such as loops, branches, and more to make it easier
1.1 Shell parsing command lineThe approximate operation of the shell when reading and executing commands is as follows:Take the following command as an example:Echo " Some files: " " \nthe date:$ (date +%f) \n$name ' s is $ ((a+4) ) "
What is the difference between this command and 2>&1 >/dev/null when you find a statement in the shell script that >/dev/null 2>&1 has not previously understood the purpose of this command? The emphasis of these two commands and the shell input and
From: http://m.jb51.net/article/56553.htm This article mainly introduced the shell script if condition judgment and the judgment condition summary, this article first gave the IF condition judgment the grammar, then gave the commonly used judgment
Linux Shell String Operations (length, find, replace) a detailed description of string-related operations is often involved in the shell batch process. There are a lot of command statements, such as: awk,sed can do string various operations. In fact,
Small Q: patriotism means that you are a national of this country, and for this country, it should be compared to otherAll countries have deeper feelings. --George Bernard Shaw=======================================================================A:
After learning about powerful text flow processing commands such as SED and awk, the simple string processing often forgets a more efficient and concise method, which is the shell's built-in string processing.1, the judgment and assignment of the
20.16/20.17 functions in the shell• The function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.Format: function F_name () {Command}The function has
The file is from the Dark Count of cnblogs,ArticleAddress: http://www.cnblogs.com/hangxin1940/archive/2011/07/10/2102087.html
Previously, it was a Windows shell, and the dark count was changed to the Linux version. This is the complete package:
Shell basic syntax
Basic shell Syntax:Like advanced programming languages, shell also provides instructions and functions for using variables.For shell, the value of all variables is a string, and the shell program uses $ VaRReference the value
1. What is shell?
In fact, I have heard of shell before I came into contact with Linux. At that time, I was talking about shell programming and I knew nothing about it. But surprisingly, I remember this term when my memory is really bad. Okay,
The color code is basically clipped between "\ e [" and "m": \ e [32; 1 m
You can use \ e [0 m to disable color output. In particular, when B is set to 1, the highlighted and bold text is displayed.
Common color codes:
Foreground background color
-
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.