The method of parameter passing in shell script is commonly used in 8 kinds
1. $# the number of parameters passed to the script
2. $* displays all parameter variables passed to the script in a single string. Unlike positional variables, this
Gets the MD5 value of the file:
$ md5sum linuxmint-12-gnome-dvd-32bit.iso|cut-d '-f1
The resulting MD5 value:Ee3d6e2ca498bc7685b7f17cdb5f2eea
Use MD5 to verify ISO files:
$ md5sum Linuxmint-12-gnome-dvd-32bit.iso >linuxmint-12-gnome-dvd-32bit.md5
This example mainly realizes the function that VB calls the external EXE program to run, this is mainly uses the Shell function to execute, the shell function is mainly used to open an external exe executable file, for example, in sub module: Shell "
System Information
Processor architecture for arch display machines (1)UNAME-M processor architecture for display machines (2)UNAME-R Displays the kernel version being usedDMIDECODE-Q display hardware system parts-(SMBIOS/DMI)Hdparm-i/dev/hda lists
Objective
I'm sure you all know that bash down time is a very useful command that can be timed for execution of a script or program, which is usually handy when it comes to a rough comparison of program execution efficiency. But you will find that
Implementation code:
#!/bin/sh
# ANSI Color-Use this variables to make output in different colors
# and formats. Color names that end with the ' F ' are foreground (text) colors, # and those ending with
' B ' are background.
Initializeansi
The original book This example is to teach debugging script, it deliberately gave a few errors in the script, teach us to understand the system prompts the error, and modify the run. But it's more difficult to write, so put the modified script up,
Formal representations (or regular representations) are arranged by special characters to search for/replace/delete one or more columns of text strings, and, simply put, formal notation is an "expression" used above the processing of strings. Formal
Objectivea problem has been encountered at work today, if you copy the files from directory A to directory B (without the file in directory B) and keep the files in directory A. The focus of the project is as follows:
You need to keep the structure
first, talk about the limitations of the Shell scripting language itself
As an interpretative scripting language, it is inherently inefficient. Although the other commands it invokes may be good in efficiency.
The execution of the shell script is
When we are testing or commissioning, sometimes you need to generate a file of size, for example, when testing the storage system, you need to reduce the amount of disk space 5G, the easiest way is to copy a 5G file over, but where to get the size
1, login to the host and enter ssh-keygen-t RSA
Prompt for enter file in which to save the key (/ROOT/.SSH/ID_RSA):
Input/root/.ssh/sea_rsa
Enter the relevant pathname and filename as prompted and generate two files (followed by two options to
Let's start a new year with these unix/linux command techniques to improve productivity at the end. I've been looking for it for a long time and I'm going to share it with you now.
>/path/to/file.log
# or use the following format
:
A case of a batch conversion directory of File encoded shell script code.
Requirements Description:As a result of turning Linux from Windows, many original win under the GBK file needs to be converted into UTF8.
The following script only judges
I am not studying things under Linux, so here is only a description of the use of shell script, I am in the process of using the problem recorded, but also write down some of the rules of the shell script syntax, easy to view later. Let's take a
In the day-to-day operation of the flow of traffic will find the phenomenon of sudden increase or increase in server load and so on, in order to find out why, need to use the Nginx limit module to access IP restrictions, and then can analyze the log.
Processing RequestsclassTestControllerextendscontroller{ Public functioninit () {if(!Yii_env_dev) { Throw NewExitexception (201, ' can not access not ' in dev mode '); } } /** * */ Public functionActionclientip ()
Suppose we define a variable as: file=/dir1/dir2/dir3/My.file.txt We can replace each other with ${} to get different values: ${file#*/}: Take out the first/its left string: Dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string:
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