Today I learned to write a shell script, a little excited, hereby recorded (actually not difficult to write it)Reason:Now do the projects that require multiple engineering dependencies, but the trouble is that there is no automatic association of
$MYSTR ="node=slave-01:2.05:1.25:1.00"$ time tmp=${mystr%%:*}; echo ${tmp##*=}real 0m0.000suser 0m0.000ssys 0m0.000sslave-${string#*pattern} minimizes matching pattern from the left and deletes (starting from the left) the first pattern
Linux shell Programming1) Write a script to complete the user input: 1. First name with 2. Last name, finally shipowner and displayed on the screen: Your full name is: content.1#!/bin/Bash2 #Program:3 # User inputs his first name and last name.
1. Turn off unnecessary servicesNTSYSV ChkconfigServices that must be turned on are: CROND/MESSAGEBUS/NETWORK/IPTABLES/SSHD/SYSLOG/SYSSTAT/SNMPDTo close unnecessary service scripts:For i in ' chkconfig--list |awk '/3:on/{print '} ' |grep-v '
such as script scripts.sh1. Create a new shellAdd statement at the beginning of the scripts file: #!/bin/sh, via ./scripts.sh(requires execute permission) or sh scripts.sh(no execute permission required)2. Do not create a new shell, execute commands
Today received the relevant departments reflect that the storage space is not enough. You need to delete some video files to make room. As soon as I took the job, I wrote a python script. Helpless, personal Python level is also an introduction. So
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
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
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)
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
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;
The hill Sort method (narrowing increment method) belongs to the sort of insert class, which is the method of dividing the whole sequence into several small sub-sequences to insert the sort separately. Hill Sort is a non-stable sorting algorithm.
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
First, the principleWindows compiled files and Linux compiled file formats are not the same, resulting in Linux running shell scripts when prompted:/bin/bash^m:bad interpreter: There is no file or directory.The reason is this:1. When the Windows
The application SP will have the requirements of registered funds, the whole network to reach 10 million, the net to reach a minimum of 1 million of registered capital, all need to be Chinese holding enterprises. Frequently asked questions about
[Linux] shell multi-process concurrency-version details, linuxshell Business background
The schedule. sh script schedules the execution of the user's trajectory project script. Part of the Code is as follows:
#! /Bin/bashsource/etc/profile; export
Here documentation in Shell
We know that operations on linux Command lines can be put in files. After the executable permission is granted, the file can be converted into a shell script. But if we talk to some programsInteractionBut shell scripts
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.