Original: Use a script to get the ip address of the Local Machine and the ip address of the script

Source: Internet
Author: User

Original: Use a script to get the ip address of the Local Machine and the ip address of the script

 

After receiving the course class, my old brother Kwai Hua started the course. Some of the simple things today can be graffiti or boring.

I want to get an IP address. It is very common in our lives. Today I will introduce you to my six methods of using scripts to get an IP address.

 

Many people want to ask me why my old sunflower brother is not an old chrysanthemum. I can only say that I am still pretty delicate.

First

 

 

Second

 

 

Third

Third

The next method is to code the routine or the city routine.

 

Fourth

IP = 'ifconfig eth0 | awk-F "[:] +" 'nr = 2 {print $4 }''

Echo "$ IP"

Fifth

Awk 'in in {FS = "[:] +"; while ("ifconfig" | getline) {a ++; if (a = 2) {print $6 }}}'

 

Old Brother Kwai Hua still hopes everyone can interact with me, regardless of whether you criticize education or not, or whether you want to give me a job.

For example, if you see my post, you may find it interesting to see that you were willing to bring me a younger brother.

If you are a young man with the same level of vision as me, you will burn yellow paper with me.

If you are an enterprise, you are willing to give me a chance to study and work.

 

Although I have just touched the threshold in Linux, I still want to go down this path in Linux for different reasons.

Maybe you want a high salary in this line. Maybe you just like me, and are interested in spending time and energy on it.

Linux is like the deeper it is, the more interesting it will be.

Here is a story to show you.

A monk asked B if your Buddha was omnipotent.

B: Yes.

A: Can your Buddha create A stone that he cannot afford?

 

# Assume that Buddha is synonymous with omnipotent power. That is to say, he can create this stone, but why can't he move it?

# It means that he is not omnipotent. If this assumption is not true, then how can he be omnipotent?

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.