Bourne shell
Introduction: Bourne shell basics and many other useful features, shell programming and organization.
Main content:Basic Introduction to. Shell, environment, options, and special characters. Shell variables User-Defined variables, environment variables, locatio
Tags: shell scripting variables Date usageWhat is 20.1 shell?
The shell is the intermediate medium used when the system interacts with the computer hardware, and it is just a tool of the system.
In fact, he has a layer of things between the shell and the computer hardware-the system hard core. If computer
required for specific applications such as Windows, text-processing programs, and libraries for programming languages. the Bourne again and the TC shells also provide further customization with the addition of history and aliases, filename and command completion, spell checking, HELP features, built-in variables set to protect the user from clobbering files, inadvertently logging out, and to define y the user when a job has completed, etc.
The shell
Functions in a shell script
The 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
}Functions must be placed at the front, function can omit the direct write function name
Show Column 1, print the shell parameters[[emailprotected]
This article collects a bunch of shell scripting tricks, I said, I write a blog mainly to make some learning notes to facilitate their own review, so I will make such an article, there is nothing incomprehensible. About the origin of these techniques, eh, I also forget, may come from Theunixschool, Commandlinefu, cool and igigo.net, of course, there are some of my own experience, tube him, into my brain is my.
0.
Shell-encrypted shc vulnerability and shell-encrypted shc Vulnerability
Recently, I have been compiling Shell scripts for customers to use. I will inevitably encounter some sensitive information that I don't want them to know. So I used Shc script encryption to compile binary files and submit them to customers, the SHC encryption vulnerability is discovered. Thi
• Simple shell programming: Shell variables◦1 System Variables◦2 Shell User Variable2.1 Foundation2.2 Use TipsAn array in the 2.3 shell◦3 Shell Environment variablesInstead of the shell version, look at the
A Shell script Introduction and First specification shell Script Description 1.1 Shell script Introduction What is 1.1.1 shell?The shell is a command interpreter which is responsible for directly working with the user in the outermost layer of the operating system to interpr
Brand foreshadowing, there is no qualification for secondary transformation. In 2012, the author of the fruit shell revealed one by one the false propaganda advertised by a medical institution named a4m (American anti-aging Medical Sciences Institute), and frequently attacked the fruit shell community as a public opinion platform, it attracted a lot of attention from traditional and
Shell learning notes and shell scriptsI. What is a regular expression?
Regular Expressions are a syntax rule used to describe character arrangement and matching modes. It is mainly used for string mode segmentation, matching, search and replacement operations.
Ii. Regular Expressions and wildcards1. Regular Expression
It is used to match matching strings in the file. The regular expression is "include match
Variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such variables are called special variables.
For example, $ represents the ID of the current shell process, the PID, as shown in the following code:
$echo $$
Run results
29949
List of special variables
variables
meaning
(New selectionadapter (){Public void widgetselected (selectionevent e ){// Instantiate the popup class. The constructor is the prompt information displayed on the popup interface.Popup popup = new popup ("Your friend XXX is online. ");Popup. Start ();}});Shell. open ();While (! Shell. isdisposed ()){If (! Display. readanddispatch ()){Display. Sleep ();}}Display.
(SelectionEvent e ){// Instantiate the popup class. The constructor is the prompt information displayed on the popup interface.Popup popup = new Popup ("Your friend xxx is online. ");Popup. start ();}});Shell. open ();While (! Shell. isDisposed ()){If (! Display. readAndDispatch ()){Display. sleep ();}}Display. dispose ();}}// Popup. java// Implement popup notif
Bash should be the most important thing we have in daily work, like our most loyal friends, and we need to know the "habits" of this friend.Bash has several different modes of operation, the login shell and the Non-login shell,interactive shell and the non-interactive shell (such as executing
| while read file do for ip in $remoteip do /usr/local/rsync/bin/rsync -vzrtopg --progress --delete $dstdir $rsyncuser@$ip::$module --password-file=$rsyncpassword echo " ${file} was rsynced" >> /tmp/rsync.log 2>1 done done
9. chmod 755 rsync. sh
10. Run the shell script and check whether the operation is successful in the corresponding directory.
11. Set auto-start upon startup
E
#!/bin/bash
a= (Dick Harry Zhao Liu) for
i ' {0..3}
do
if Ping-c 1 192.168.1. $ ((${i}+1)) >dev/null 2> 1;then
Echo $ ((${i}+1)) "${a[${i}]}" online "
else
Echo $ ((${i}+1))" "" ${a[${i}]} "offline"
fi
Done
This string of shell code implements the ping of the name of the IP address that is used for the online
The knowledge points involved are variables, array
Shell Script Introduction
Shell is a scripting language
You can use logical judgments, loops, and other syntax
Functions can be custom-defined
The shell is a collection of system commands
Shell scripts enable automated operations, which can greatly increase our operational efficiency
Here I will first describe what a shell is, and then introduce my first shell program and summarize the experience from it.
First, what is the shell
Before talking about my shell program, I would like to talk to you about what is shell, I believe that the word
Linux Shell wildcards, escape characters, metacharacters, special characters, 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 wildcards in shell commands
This article is part (iii) of the Linux Shell Series tutorial, more on the Shell Tutorial: Linux Shell Series Tutorials
The shell is an advanced scripting class language and also supports custom variables. Today we will introduce you to the variables in the shell in the
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.