Common shell Scripts

#!/bin/bash # Check if the 192.168.1.1-192.168.1.254 host is aliveFor IP in 192.168.1. {1..254};DoIf ping-c 1 $ip >/dev/null; Thenecho "$ip OK."Elseecho "$ip no!"FiDone#!/bin/bash #检查多个域名是否可以访问Url= "www.baidu.com www.sina.com www.jd.com"for URL in

Shell uses the Paste command to stitch multiple files by column

Test documents:[email protected] shell-script]# cat Text1.txt12345[email protected] shell-script]# cat Text2.txtOracleMysqlPostgreSQLHadoopSparkUsing Paste stitching text1.txt text2.txt file contents:# paste Text1.txt text2.txt1 Oracle2 MySQL3

Linux Shell Script Programming learning notes and combat

Http://www.1987.name/141.htmlShell Basics Terminal printing , arithmetic operations , frequently used variables Search for a specific string under the specified folder and highlight matching keywords under Linux Get standard input from a

Daily operations Work Shell script case

1, list_sys_status.shDisplays the following information used by the system:Host name, IP address, subnet mask, gateway, DNS server IP address information#!/bin/baship= ' Ifconfig eth0 | head-2 | Tail-1 | awk ' {print $} ' | Awk-f ":" ' {print $} 'zw=

<< reprint >>shell Some mighty commands

---------Transferred from http://www.runoob.com/linux/linux-shell-array.html----------Copyright belongs to the original! Shell some powerful commandsShare some shell usages and scripts that you may not know about, simple & powerful!Before reading

On-my-zsh pretty shell.

OneHttp://www.cnblogs.com/GarveyCalvin/p/4301235.htmlTwoForeword: Zsh can be configured strong, user can customize the configuration, personalization is strong. Zsh Tab Completion is more powerful, this feature allows us to save a lot of time. Zsh

Shell Test command, Loop statement

Test command, Loop statementTest command format:Test conditionUsually, in the If-then-else statement, [] instead, that is, [condition]. Note that there are spaces on both sides of the square brackets.Common commands:-a two conditions at the same

Shell Programming Basics

Shell Authoring Steps:1. Scripting Vim first.sh2. Write the complete test script Bash-n first.sh3. Granting permission chmod +x first.sh4. Execute the script./first.shPS Shell Script Learning first need to understand Linux, system commands and

[Shell]system and EXECLP simple examples

shell script : hello.sh#!/bin/bashecho"I am in shell script"echo"param 1 is'echo'param 2is $"variable=$[$1 + $2 ]echo"sum is $variable"System Interface : SYSTEM.C#include void main (void) { printf ("I am in C code!\r\n" System ("/bin/bash"). /

Simple shell implementation

http://blog.csdn.net/lishuhuakai/article/details/11928055#include #include#include#defineMAXLINE 80voidSetup (CharInputbuffer[],Char*argv[]) { intI, J; Char*p; I=0; for(p = inputbuffer;;p + +)/*Splits the character command for a period of time,

Wrote a simple Linux shell to download files

#!/bin/SH for((i=0; i -; i=i+1)); Do# Use the spider to detect if the requested resource exists and write the result of the request to a

Several commonly used text-processing shell commands: Find, grep, sort, uniq, sed, awk

Find File LookupFind txt and PDF filesFind. \ (-name "*.txt"-o-name "*.pdf" \)-printFind files that start with all lettersFind. -name "[a-a]*"Find all non-txt text with negative parametersFind. ! -name "*.txt"-printSpecify the search depth to print

Shell Script-Compare two integer sizes

DevelopmentShellscripts are implemented with script arguments , respectively, andReadRead inthe way to compare2an integer size. Use conditional expressions (prohibitif) and remind the user to compare the results in the form of a screen output. Note:

Add the shell script to the system service

Have you ever felt that it's hard to write a long, absolute path when executing a script, to make it easy and easy to write your own script and start your footsteps as if you started Apache. (PS: Actually Apache is also a script)First, to understand

HDU5730 Shell Necklace

Time limit:16000/8000 MS (java/others) Memory limit:65536/65536 K (java/others)Total submission (s): 999 Accepted Submission (s): 434Problem descriptionperhaps The sea ' s definition of a shell is the pearl. However, in my view, a shell necklace

Spark-shell Startup script Interpretation

#!/usr/bin/Envbash## Licensed to the Apache software Foundation (ASF) under one or More# contributor license agreements. See the NOTICEfiledistributed with# this work foradditional information regarding copyright ownership.# the ASF licenses

Use shell scripts to simply simulate simultaneous read and write operations to specific files

Use shell scripts to simply simulate simultaneous read and write operations to specific filesFormat of file contents:Field1, Field2, field3, Field4As a delimiter, but there are spaces. The script uses the following:

Shell learns 32 days----read reads a row

Standard input and output with standard error outputStandard input/The output is probably the most important concept in the design principles of software tools..His idea was to:The program should have a data source,Data Export(where are the data

Linux Shell ${} simple usage

Turn from:Linux shell ${} simple usageFor the sake of completeness, I'll use some examples here to illustrate some of the supernatural powers of ${}:Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtWe can replace each other with ${}

Java Execute shell/cmd command

Try{Process P=runtime.getruntime (). exec ("chmod 777/home/bomb/movetoy/webroot/a.sh" ); P.waitfor (); Process Pro= Runtime.getruntime (). exec ("/home/bomb/movetoy/webroot/./a.sh" +num); Pro.waitfor ();

Total Pages: 541 1 .... 248 249 250 251 252 .... 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.