Shell script: Print 99 multiplication tableToday in three different ways to achieve the shell script Print 99 multiplication table, the code is as followsMethod 1: Use a For loop (a.sh)#!/bin/shfor i in {1,2,3,4,5,6,7,8,9}do to J in {1,2,3,4,5,6,7,8
1. FunctionsShell functions, which are used to customize a segment of a program. To simplify the code. Grammar:Funtion fname () { //do something}The shell is top-down, executed from the left and right. So the definition of the function needs to
Not long ago, once searched a blog is to read the configuration file, http://www.cnblogs.com/bo083/archive/2012/11/19/2777076.html, used to now, feel very convenient, thank the author.Now, a web interface is required to allow the user to modify a
Defining functions in the shell allows the code to be modularized to facilitate reuse of code. But the scope of the variables and functions of the script itself can be confusing, and here's a look at the problem.(1)The variables defined in the shell
Similar to other programming languages, the shell supports A for loop.The general format for A for loop is: for inch List Do command1 command2 ... CommandN DoneA list is a sequence of values (numbers, strings, and so on), each separated
The syntax for the most streamlined if command is:if TEST-COMMANDS; then CONSEQUENT-COMMANDS; fiafter the Test-command executes and its return status is 0, the consequent-commands executes. The return status is the exit state of the last command, or
just as soon as they came out, they were dumped out of DEX by the ghost Brother, which made it easy to crack. At first, I tried it with the zjdroid artifact, but I had never been worried about the success of the dump operation. One day, a reverse
1. FTP automatically logs in to batch download files.##### From/home/data on the FTP server to the local/home/databackup #####! /Bin/bashFTP-n Open 192.168.1.171User guest 123456.BinaryCD/home/DataLCD/home/databackupPromptMget *CloseBye!2. FTP
This article is based on the "Unix/Linux Programming Practice tutorial". This is a book that explains programming for Unix systems. It focuses on practice and is difficult to understand. We recommend that you read this article, there will be a
1. Introduction to IFS
The shell script has an internal domain separator called ifs (internal field seprator. The complete definition is the shell uses the value stored in IFS, which is the space, tab, and newline characters by default, to delimit
Target
Implement recording of shell execution start time, end time, running status, error information, etc. Use the function to encapsulate log records and use scripts to call functions.Source code universal function script
READ command-N (do not wrap)-P (prompt statement)-N (number of characters)-T (wait time)-S (do not echo)
1. Basic readThe read command receives input from standard input (keyboard) or input from other file descriptors (as described later ). After
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
1 case description
A company needs to install a centos operating system on a large number of servers. It is time-consuming and labor-intensive to manually install one. Therefore, it is very important to build a PXE Server. the system server is
The Shell script calls a specified function through passing parameters.
When writing some functional scripts, we usually put functions with similar operations or similar parameters in the same shell script, which is convenient to manage, easy to
Shell Learning & amp; and | what is the difference?Before answering the questions in this chapter, let's first understand the concept of return value!Each command or function we run in shell will return a value of the parent itinerary at the
Use of shell Learning () and {}In 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:()
[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
EMACS
If Bash finds that the value of this variable is 'T' in the environment when the shell is started, it considers that the shell runs in the Emacs shell Buffer and does not allow row editing.
ENV
Similar to BASH_ENV, it is used in shell
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