Shell Learning notes Eight (function)

Tag:shell    function     function definition: 1, no return value #function为关键字, function_name for Function name function function_name () {com Mand1 Command2 ...} Omit the keyword FUNCTION, the effect is the same as

Automatic restart of monitoring program with Shell script

Very few shell scripts, recently wrote a shell script, encountered some problems, unexpectedly was tossing for a long while. These errors are too low and should not be. While there is now time, the entire process of executing the shell script is

Simple menu Script under shell

Menu.sh Menu Interface Script#!/bin/bash#menu. ShFunction menu () {Cat #############################################' Echo-e ' \033[32;40m menu \033[0m "'#############################################* 1) Add a user* 2) Set password for user* 3)

Shell Programming Tmpwatch

As a system administrator, it is often necessary to periodically clean up certain rules of the file, such as expired logs, expired archives, backed up files, and so on.If you use certain matching rules to find these files and then pass them to the

Linux Series-shell Learning Notes (cont.) Handling User Input

1. Running a program with parameters$ A indicates the name of the program, which represents the first argument, and the second argument, and so on, until the nineth parameter $9# VI Factorial#!/bin/shf=1for ((i=1;iTest:[Email protected]

Two ways to ping a heap of machines (shell or fping)

cat ip.sh#!/bin/bash#--------------------------------------------------   #Created: 2015-04-28# Author:jimmygong#mail:[email protected] #Function:p ing#version:1.0#---------------------------------------

Shell Programming Note one

Shell Programming:Bash Variable type:Environment variablesLocal variables (local variables)        Positional variables        Special variables (built-in)Local variables:Varname=value: Scopes are available for the entire bash process;     

Shell's $

$$: The process ID representing the shell script $!: The process ID representing the last executed shell script $?: Represents the return value of the last executed shell command $*: Represents all parameters in the form "parameter one

Shell script--DHCP Automatic deployment

For more information, refer to:(iii) Play with Me Linux Network service: master server configuration for DHCP service configuration1#! /bin/Bash2ipsag="10.10.10"3dnsip="10.10.10.10"4dn="ns.gr.org"5Cat >/etc/dhcpd.conf 6ddns-update-style

Shell Programming---Character testing and for loops

A. Character test= =: Test for equality, equality is true, not equal to False! =: Test Whether it is unequal, not equal to true, etc as false>-N String: Tests whether the specified string is empty, empty is true, or false-Z String: Tests whether the

Shell Learning Note (2) Replace command • • The difference from ()

· CMD in the execution of the shell regardless of · What is the content of, advanced interpretation, and then the interpretation of the final results to the shell, if the result of interpretation is not the shell can command, will be error. However,

Shell Learning Notes (1)-Variables

1, the variables in the shell can be customized, the shell uses the variable with the $Name= "Shero"echo "Hi ${name}"[Email protected]:/home/shero/shell#./test2.shHi SheroNote that there can be no spaces between the variable name and the equals sign,

Using threads to synchronize dynamic display of the current system time on the shell

Create a thread to refresh the current system timeNew Thread () {public void Run () {Here is another separate thread, not a UI threadDisplay Dis=shell.getdisplay ();while (true) {Non-UI thread access UIif (!shell.isdisposed ())//whether the current

Shell simulation Two-dimensional array parsing configuration file

The first few days of the project team out of the shell OJ questions to practice, the topic is about:The existing configuration file Conf.ini as follows, write the shell, enter title and key, output its value,If input FIFO1 a1, then output 11file

Shell programming notes

Shell programming notesShell programming:Bash variable type:Environment VariableLocal variable)Location variableSpecial variables (built-in)Local variable:Varname = value: applies to the entire bash process;Variable naming rules:1. It can only

Linux series-shell learning notes (Continued 1) process user input,-shell learning notes

Linux series-shell learning notes (Continued 1) process user input,-shell learning notes 1. Run the program with Parameters $0 indicates the program name, $1 indicates the first parameter, $2 indicates the second parameter, and so on until the ninth

Here documentation in Shell,

Here documentation in Shell, We know thatlinuxCommand Line operations can all be placed in the file. After the executable permission is granted, the file can be changed toshellScript. But if we talk to some programsInteraction,shellScripts cannot

Shell programming tmpwatch, shelltmpwatch

Shell programming tmpwatch, shelltmpwatch As a system administrator, you often need to regularly clear files with certain rules, such as expired logs, expired archives, and backed up files. If you use certain matching rules to find these files and

Shell programming oracle10g installation preparations before rhel6.4, oracle10grhel6.4

Shell programming oracle10g installation preparations before rhel6.4, oracle10grhel6.4 OS: rhel6.4 Oracle: 10.2.0.1 Because oracle10g has been released for a long time and many packages used for 10g have been updated to a new version, many strange

Shell script programming (quick sorting)

Shell script programming (quick sorting) #! /Bin/bash # implementation of fast sorting in shell script programming (using the rightmost element as the element) a = (8 5 10 3 2 93 4 1 2 3 40 9 61 8 6 29) # a = (0 0 0 0 1 2 3 3 4 4 8 28 30495 921 43716

Total Pages: 541 1 .... 477 478 479 480 481 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.