Shell Scripting Exercise 004

1.#!/bin/bashfor IP in 133 134 doname_8808= ' Nmap-p 8808,15080 172.16.1. $ip |sed-n "5" P|awk ' {print $} ' name_15080= '   Nmap-p 8808,15080 172.16.1. $ip |sed-n "6" P|awk ' {print $} ' if [$name _8808 = open-a $name _15080 = open] Then echo

Shell Script First Experience

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

Linux Shell string Cutting built-in method

$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 Programming

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.

Shell Basics Exercise Notes

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 '

Bash-shell-scripts Advanced Script Configuration IP address

[[email protected] shell]# cat mod_ip_hostname.sh #!/bin/bash#auto modify  Ip and hostname#by colin on 2015-05-07ip_config= '/etc/sysconfig/network-scripts/ Ifcfg-eth0 ' hostname_config= '/etc/sysconfig/network ' hosts_config= '/etc/hosts '

Shell two classes of execution methods

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

Shell script to delete the specified directory file based on field state

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

Spark-shell First Experience

1. copy files to Hdfs:[email protected]:/usr/local/hadoop$ Bin/hdfs Dfs-mkdir/user[Email protected]:/usr/local/hadoop$ Bin/hdfs Dfs-mkdir/user/hadoop[Email protected]:/usr/local/hadoop$ Bin/hdfs

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

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;     

Hill Sort method (Shell sort)

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.

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

(original) A shell script compiled under Windows can no longer work with Linux in a workaround

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

Acquisition of SP Shell Company

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

[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

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

Total Pages: 541 1 .... 487 488 489 490 491 .... 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.