Today see a help post ask this thing again, so boring wrote a.
With the awk script, which is that the script interpreter uses/usr/bin/awk instead of/bin/sh
But it's all a script, if you want to.
You can call me this awk script with a shell
Let command introduction:
Let command allows the bash shell to perform arithmetic operations, using lets to compare two operational values or perform operations such as subtraction, which are often used in the process control structure of the shell
Q: What is a shell and what is a shell script? The A:shell is a program written in C that is a bridge between the user and the Linux operating system. Users can either enter command execution and use shell scripting to accomplish more complex
1 script in Windows, the path is backslash \, in Linux, the path is slash/, you need to replace the backslash with a slash, using the SED command, as followsSed-i "s:\\\:\/:g"/home/pp/install.sql replaces \ sed-i "S:04risk\::ig"
Shell script is similar to batch processing under Windows/dos, that is, the use of various commands pre-placed into a file, convenient one-time execution of a program file, mainly for the convenience of administrator settings or management. The
Shell scripting language is an important tool to implement LINUX/UNIX system management and automation operations, and the core of the Linux/unix system is mostly concerned with the contents of shell scripts. Every qualified Linux system
First, conditional judgment statementMeet the criteria to execute the corresponding command[Condition]: more commonly used in scriptsCases:[-f/etc/hosts]Test condition: More commonly used for Linux character terminals1. File or directory judgment-F:
1. Conceptually"[[" is a keyword, and many shells (such as ash BSH) do not support this approach. Ksh, Bash (reportedly introduced support for [[support] from 2.02 onwards."[" is a command that is equivalent to test and is supported by most shells.
How to read a file:First step: Pass the contents of the file to the while by pipe (|) or redirect (The second step is to call read in the while and read the contents of the file one line at a time and pay the value to the variable following read.
1, determine whether a number is in the one-way.#!/bin/Bashread-P"pls input a number:"N Case "$n" inch 1) Echo "variable is 1" ;; 2) Echo "variable is 2" ;; 3) Echo "variable is 3" ;; *) Echo "pls
Logical judgment in the shellFormat 1:if condition; Then statement; FiIf it's what it is, then what happens?Write a simple script that means when a=5, when a is greater than 3 o'clock print OK#!/bin/bashA=5If [$a-GT 3]ThenEcho OKFiExecute script
How awk WorksThe first step: Execute Begin{action ...} Statements in a statement blockStep two: Read a line from the file or standard input (stdin), then execute the pattern{action ...} Statement block, which scans the file row by line, repeating
all the process according to my experimentAnd I can accept the way to understand, we can refer to, if there is a problem, please leave a message.Sample Data[email protected] ~]$ cat
Shell Alarm System
Demand:Use Shell to customize a variety of personalized alarm tools, unified management, standardized management;
Ideas:Specifies a script package that contains the main program, subroutine, configuration file, mail
8.1 Shell Introduction8.2 Command History8.3 Command Completion and aliases8.4 Wildcard Characters8.5 input and output redirection
8.1 Shell Introduction
The shell is a command interpreter that provides interaction between the user
There are some differences between the interactive shell and shell scripts of Linux, mainly because of the existence of a separate running process, so there is a difference between the acquisition process PID.Interactive Bash Shell get process
Functions in the shellThe 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 to be on the
First, in Eclipse, the Java program is made into a runnable jar package1. Simply package the SRC directory and the third-party jar in the Lib directory 2. After selecting these two positions, "next", then "Finish", generate the Jar package3. Build
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.