Conditional judgment in shell programmingConditionsIf-thenCaseIf-thenSingle conditionif commandThenCommandsFiWhen the command return code is 0 o'clock, the condition is setif.sh#! /bin/Bashif Date Then Echo "command EXEC"fiifdate123 Then
I. Introduction to the DATE commandFunction: Used to display time, this command is used much in the shell scriptFormat: Date + parameter + formatParameter:-D to display the specified timeDate Show current time April 13, 2016 Wed 14:33:55
Special variables:$?: The execution result of the previous command returns a value of 0-255,0 for execution success, and other values indicate unsuccessful execution$!:shell PID of the last running background processPID of the $$:shell itself$:
Linux Shell Advanced Tips (i)Http://www.cnblogs.com/stephen-liu74/archive/2011/12/22/2271167.htmlFirst, the input information is converted to uppercase characters before the condition judgmentSetting output level for debug informationThird, judging
Before writing this shell, let's talk about how the stat command is usedFirst, about time stampEach file has 3 of the time (called timestamp timestamps), for these 3 kinds of time, many times easily confused, so here to explain: Access Time ( Atime)
Similar to other programming languages, the shell supports A for loop.The general format for A for loop is:For variable in list do Command1 command2 ... CommandndoneA list is a sequence of values (numbers, strings, and so on), each
Generating random numbers in Linux can use the $random variable.The Man Bash command looks at the explanation of the random.Random each of the parameter is referenced, a random integer between 0 and 32767 is generated.As you can see, the $RANDOM
Linux Shell intercepts strings
There are many ways to intercept strings in the shell${var#*/}${var##*/}${var%/*}${var%%/*}${var:start:len}${var:start}${var:0-start : Len}${var:0-start}
Here are a few examples to illustrate:1) Get the
Noun Explanation:Cron system scheduling process that can run jobs at a certain time interval or at a fixed point in time& Use it to run a process that takes a long time in the backgroundNote:Cron is a system scheduling process that can run a job
A function is the name of a command or a set of commands.
Functions can make the program modular, thus improving efficiency.
The shell stores functions in memory rather than in disk files, so accessing the function is much faster than accessing
1, command substitution: 'Inverted single quotes, also called heavy notes. On the keyboard and the ~ key together of the key yo, do not knock into single quotation marks.AAfter using ", the shell first replaces the date command enclosed in the
Variable, which provides a way for users to store, retrieve and manipulate data.
Environment variables, positional variables, predefined special variables, user-defined variables
Environment variables(1) Shell environment variables, is a class
The Shell's English interpretation is the shell, echoing with the kernel kernel noun, one outside, one shell and one core. The kernel is like the Bank of Switzerland's treasury, storing the customer's gold and many other (hardware) assets,
Linux+shell Administrator's Good helper--batch decompressionRecently, the company has been busy with OA on-line work, as an administrator, it is necessary to provide them with data backup and recovery operations, the main operation is to restore the
Recently installed VSFTPD to do FTP service, found that the system user login shell is set to/sbin/nologin, you cannot use the FTP service. Online data said that VSFTPD will be for each FTP login user to check the corresponding login shell
PowerShell Remote Management employs a new communication protocol, Web Services for Management, referred to as Ws-man it works over HTTP or HTTPS, and the implementation of Ws-wan is primarily based on a background service: Windows Remote Management
In the open-source Unix system usually for the convenience of management will be a lot of use of shell script, and in peacetime writing script when the fast and effective is a lot of built-in variables can be used, here is a simple summary of the
Task 1. Paper Shell (box.pas/box.c/box.cpp)"Title description"MCX is a child with a mild cleanliness. One day, when he was addicted to the math paper difficult to extricate themselves, vaguely think of their own learning probability of the time to
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