Shell Script Collection

Source: Internet
Author: User

#本人新手写的不好之处, be sure to advise me. I will update this content on an irregular basis.

1. Enter the IP address to find the domain name specified in the/etc/hosts file

#!/bin/sh#author VPERSON#QQ 737304790#enter The specified IP to find the corresponding domain name in the hosts fileflag=0 If [$#-ne 1]thenecho "Input error" echo "Usage: $127.0.0.1" Exit 1fiexec </etc/hostswhile read Linedoif ["$" = "'  echo $line |awk ' {print '} ' "]thenflag=1printf" successfully find the domain name!\n "echo-e" \033[31m $1==>> ' echo $line |awk ' {print $} ' \033[0m ' breakfidone[${flag}-eq 0] && echo "No specified IP"




This article is from the "10846118" blog, please be sure to keep this source http://10856118.blog.51cto.com/10846118/1943506

Shell Script Collection

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.