Sometimes, you can extract only a part of a text segment by using shell's greedy match. % is a match from the right to the left, and # Is a match from the left to the right, as shown in the following example:
[Root @ WWW ~] #Qq = www.qq.com
Linux Shell is much more powerful than Windows batch processing in programming, whether in loops or operations. Data Types cannot be compared. The following is a summary of some operations on the array when I am using it.
1. array
Wshshell object
Progid wscript. Shell
File Name wshom. ocx
CLSID F935DC22-1CF0-11d0-ADB9-00C04FD58A0B
IID F935DC21-1CF0-11d0-ADB9-00C04FD58A0B
The following table describes the properties related to the wshshell object.
Attribute
Alas, I didn't learn shell, and my colleagues encountered a problem. I asked my classmates if it was necessary to learn it. It wasn't complicated, but the syntax was too strange and I really didn't understand it.
I wrote a simple script.
#!
Conditional expression:
1. File expression
# If the file exists if [-f file] # if the directory exists if [-d dir] # if the file exists and is not empty if [-s file] # if the file exists and is readable if [-r file] # if the file exists, you can
Functions in shell are similar to methods in Java. script code is placed in the function and can be run anywhere to reduce a large amount of repeated code.
Understanding Shell functions involves the following aspects: function creation, function
Classic shell is a tool used to optimize Windows 7 and 8 user interfaces.
The motivation for the software development was to be dissatisfied with Windows 7's removal of the classic "start" menu. As a result, he developed his own program to replace
Shell:
#! /Bin/bash #=============================================== ====================================## this example show you how to get data from pipe #====== ========================================================== =============== while
Operator
Description
Example
File comparison operator
-EFilename
IfFilenameYes, true
[-E/var/log/syslog]
-DFilename
IfFilenameIs a directory, it is true
[-D/tmp/mydir]
-FFilename
IfFilenameIs
> Append
> Overwrite
> & Set the previous storage location to the next storage location
P.S.: Of course, there is still an inverse
0 standard input
1 standard output
2 standard errors
Example:
ls /usr/tmp 2> err.file
Write the error generated
Redirection
File Code: 0, 1, 2 ,... output
Most of the conversion semantics cannot be used independently and must be used together with the Bash command.
Operation file:
Fd <> FileFd file code, available for reading and writing
Fd Close input
Function
Bash does not enable a new sub-shell to call a function. It is executed in the existing shell environment.
Syntax:
Function Name (){Command Area}Function Name (){Command Area}Function Name{Command Area}
Call: function name parameter 1
Sometimes, we need to repeat the previous commands in Bash. Of course, you can use the up arrow key to view commands that have been run before, but this article introduces some better ways, such !!,! A ,! Number ,! -Number ,! $, Ctrl + r, and other
Linux ShellStrong Regular ExpressionsGrep
Linux grep commandUse 'grep' to search for text filesIf you want to find a string in several text files, you can use the 'grep' command. 'Grep' searches for the specified string in the text.Suppose you are
What isShell
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?
I. Shell VariablesIt mainly includes local variables and environment variables.
1. Local variable -- Used in the script currently running by the user1)Define local variablesFormat: variable-name = valueExample: [root @ jike1/root] # LOCALTEST =
In oracle, you can use the dbms_job package to regularly execute pl/SQL and SQL processes. crontab can only be used for scheduled tasks at the operating system level, such as backup.
This article describes the specific usage of crontab for memo.
In
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.