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?