When to use the shell
Because the shell appears to be a common feature between UNIX systems, and has been standardized by POSIX. As a result, the shell script can be applied to many systems as long as it is written "attentively". Therefore, the
Core code
You can try these small functions when you encounter a system with a date command that does not give you power.
#日期转天数 function Date2days {echo "$*" | awk ' {z=int (14-$2)/12); y=$1+4800-z;
J=int ((153*m+2)/5) +$3+y*365+int (
Brief introduction
Awk is a powerful text analysis tool that is particularly powerful when it comes to analyzing and generating reports on data, compared to grep lookup and sed editing. To put it simply, awk reads the file line by row, using a
If you need to use PHP to connect to a Microsoft SQL Server 2005 database on a Linux system, our common way to connect to a database is to use ODBC to connect.
FreeTDS provides an open source client for the TDS protocol for Linux systems. Because
Use shell script to monitor whether a process exists without a startup instance, first on the code dry:
#!/bin/shPs-fe|grep processstring |grep-v grepIf [$?-ne 0]Thenecho "START process ..."Elseecho "Runing ..."Fi#####Processstring represents a
Iterating and traversing the lines, words, and characters in a file is a very common operation when you are working on a text file. Using a simple loop for iterations, plus a redirection from stdin or files, is the basic way to iterate through the
Theoretical part:The loop means that the program executes some statements repeatedly;Whiler loop is a kind of cyclic structure, when it is not known in advance how many times the loop executes, it is necessary to use the while loop; while the
Create a scriptThere are many different shells in Linux, but usually we use Bash (Bourne again shell) for Shell programming because bash is free and easy to use. So the script I've provided in this article is all about using bash (but in most cases
20.5 logical Judgments in shell scripts• format 1:if conditions; Then statement; FiExample: a=5If [$a-gt 3]; then echo OK; Fi[Email protected] shell]# sh If1.shok• format 2:if conditions; Then statement; else statement; FiExample: a=5If [$a-gt 3];
Chapter 23rd using other shellsThe bash shell is the most widely used shell in the Linux distribution. But it's not the only option, and there are other shells you can choose from.23.1 What is dash shellBaidu Encyclopedia said: Dash Shell is a Unix
There are many shell operators, relational operators, arithmetic operators, Boolean operators, string operators, and file test operators1, arithmetic operatorsAcoustic Bash does not support simple arithmetic operations, and you can use the Expr
The purpose of this paper is to review 3 kinds of IF statements and case multi-branch structure statements that the shell implements for branching, and to supplement the execution efficiency of if and case.Knowledge Reserve
The
Tutorial target: DD Wipe command disk empty shell script, notebook desktop Mac UniversalDate: August 20, 2015Contact e-mail: [Email protected]Q q Group: 1851 1570151CTO Blog Home: http://990487026.blog.51cto.comProduction demand:The number of
In the shell of Linux, echo changes the output display style echo-e "\033[32;49;1m [done] \033[39;49;0m" or echo-e "\e[32;49;1m [done] \033[39;49;0m"Output result: [Done]The color of the text terminal can be generated by using the ANSI
This article records my common or useful system-level commands under the Linux system, including hardware and software view, modify commands, CPU, memory, hard disk, network, System management and other commands. However, this article does not
Shell
Shell is a program with special functions. It is an interface between the user and the core program (kernel) of the Unix/Linux operating system. Why do we say shell is an intermediary between the core program of the system and the user?
How to interpret quotation marks in Unix Shell
Shell can recognize four different types of leading characters: single quotes character 'double quotation marks character "backslash character \ backquotes character '1. Single quotes ('')
Howard @ 0
Linux shell Escape Character metacharacter wildcard special character summary, shell escape1. linux shell wildcard (wildcard)
Wildcards are processed by shell (not by the command statements involved, but we have not found any introduction to these
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.