Problem Description:D:\ADB>ADB ShellADB server is an out of date. Killing ...ADB server didn ' t ACK* Failed to start daemon *ErrorWorkaround:is the ADB server port is occupiedYou run the ADB nodaemon server first to see what the ADB server port is
1. Write a script that calculates the factorial of 10 using a loop #!/bin/shFactorial=1For a in ' SEQ 1 10 'Dofactorial= ' expr $factorial \* $a 'Doneecho "10! = $factorial "2. Write a script, after the execution, print a line prompt "Please input a
The array in the shell is the same as other programming languages, considering that the shell is a weak type of scripting language that can be defined and used directly in command limeFor example:$a [1]= "Monday"$echo ${a[1]}Monday$Note that here
Http://www.1987.name/141.htmlShell Basics
Terminal printing , arithmetic operations , common variables
Search for specific strings in the specified directory under Linux and highlight matching keywords
Get standard input from a keyboard or
As a database DBA for Linux systems operations or Linux, there are many times when you need to write scripts to help us achieve some of the requirements, and if some content within the script can try parallel processing, it will greatly improve the
The scenario where the problem occurs is probably 1 cron calls a Python script 2. In the Python script, call a shell script (for log analysis) to obtain the shell output and then send an email. Similar to a monitoring task. There is no
I. Learn the knowledge reserve of shell programming 1. Related Linux system command applications; 2. Familiar with VI/Vim editor and related client software settings; 3. Basic services: NTP, crond, and network services: NFS, rsync, inotify,
In shell, the display format of commonly used date is as follows:
Date + % f // 2007-03-06Date + % Y % m % d // 20070306
Date + % t // 23:37:11
// YesterdayDate + % Y % m % d-d "-1 day"// TomorrowDate + % Y % m % d-d "+ 1 day"// Last monthDate + % Y
Shell is an important tool in Unix/Linux to parse user input commands. Next we will implement a simple shell program to practiceFork/exec/Wait/exitBy the way, we recommend a book titled understanding Unix/Linux programming-A Guide to theory and
Awk
Awk is a programming language used to process text and data in Linux/Unix.
SedSed is a stream editor that is a very useful tool in text processing.
GrepGrep is a powerful text search tool, which is often used in combination with pipelines.
If judgment
I have also written a simple shell script before, and it is not transferred to O & M. It has less work related to the system, so it is not very skilled.
Recently, as the system has encountered various messy problems and no one has helped
While test conditions
Do
Statement 1
Statement 2
Done
Test condition: if the condition is met, the loop is closed until the condition is not met.
How does a while loop exit? Change the variable value corresponding to the test condition in the loop
Generally, we use tr to replace strings or delete specified strings.
The TR syntax is as follows:
Tr [Option]... set1 [set2]
-C,-C, -- Complement
First complement set1
Replace the characters not in set1 with set2
[[email protected] ~]$ echo
Arithmetic Operations
The arithmetic operations mentioned here refer to addition (+), subtraction (-), multiplication (*), Division (/), and remainder (%, you can add parentheses to change the priority and only perform operations on integers (Linux
Tag: ShellIn shell command line, the average person may not care much about the differences between the two pairs of symbols () and,
Although both of them can group multiple commands, the technical details are quite different:
() Place the Command
By long Luo
Recently
Weather ForecastProject, you need to download some weather icons from Yahoo, but because there are many icons, there are more than 80. Icons are stored on the Yahoo image website.
Thunder does not support HTTPS download.
The day before yesterday, I briefly shared some opinions on using shell to write web crawlers. Today I specially sent the code and shared it with 51 bloggers. I still love technology, open source, and Linux.
For the annotation and overall conception
[Shell] if common judgment conditions and shellif judgment ConditionsIF judgmentI have also written a simple shell script before, and it is not transferred to O & M. It has less work related to the system, so it is not very skilled.Recently, as 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.