IP-адрес в строке приглашения bash

Открываем для редактирования .profile в корневом каталоге пользователя:

vim ~/.profile

Далее добавим строку

export PS1=`/sbin/ifconfig en0 | /usr/bin/perl -ne 'if ( m/^\s*inet (?:addr:)?([\d.]+).*?cast/ ) { print qq($1\n); exit 0; }'`:$PS1

После этого получим что-то типа этого

Untitled-3Открываем для редактирования .profile в корневом каталоге пользователя:

vim ~/.profile

Далее добавим строку

export PS1=`/sbin/ifconfig eth0 | /usr/bin/perl -ne 'if ( m/^\s*inet (?:addr:)?([\d.]+).*?cast/ ) { print qq($1\n); exit 0; }'`:$PS1

После этого получим что-то типа этого

Untitled-3

21 комментарий к “IP-адрес в строке приглашения bash

  1. This is the right site for anybody who wishes to understand this topic. You realize a whole lot its almost hard to argue with you (not that I actually will need to…HaHa). You definitely put a brand new spin on a subject that’s been written about for years. Great stuff, just wonderful!

  2. Aw, this was an actually great article. In suggestion I would like to place in writing such as this additionally? requiring time as well as real effort to make a great post? but what can I claim? I postpone alot and also by no means seem to get something done.

  3. Aw, this was an actually wonderful post. In idea I want to place in creating such as this furthermore? requiring time as well as real initiative to make a very good post? yet what can I say? I put things off alot and never appear to get something done.

  4. I have to thank you for the efforts you’ve put in writing this site. I am hoping to see the same high-grade blog posts by you in the future as well. In truth, your creative writing abilities has motivated me to get my own, personal site now 😉

  5. Can I simply claim what a relief to discover somebody who in fact knows what theyre talking about on the internet. You absolutely know exactly how to bring a problem to light and make it important. More people need to read this and also comprehend this side of the tale. I angle think youre not extra preferred due to the fact that you certainly have the gift.

  6. Youre so amazing! I do not intend Ive read anything similar to this prior to. So great to locate somebody with some original thoughts on this subject. realy thanks for starting this up. this web site is something that is required online, somebody with a little creativity. useful task for bringing something brand-new to the web!

  7. Aw, this was a truly great article. In suggestion I would like to put in composing like this in addition? requiring time and actual initiative to make an excellent short article? however what can I claim? I put things off alot and by no means appear to get something done.

  8. There are certainly a lot of information like that to take into account. That is a wonderful indicate bring up. I supply the ideas over as basic ideas however clearly there are inquiries like the one you raise where the most important thing will certainly be operating in straightforward good faith. I don?t recognize if ideal practices have actually arised around points like that, but I make sure that your job is plainly recognized as an up for grabs. Both young boys and women really feel the impact of simply a moment?s enjoyment, for the rest of their lives.

  9. Youre so cool! I don’t expect Ive read anything like this prior to. So nice to find someone with some original ideas on this subject. realy thank you for starting this up. this internet site is something that is needed on the web, somebody with a little creativity. helpful task for bringing something brand-new to the internet!

  10. There are definitely a great deal of information like that to take into consideration. That is an excellent point to raise. I offer the ideas above as general inspiration however clearly there are concerns like the one you raise where one of the most vital thing will be operating in straightforward good faith. I don?t know if best practices have actually emerged around points like that, yet I make certain that your job is clearly identified as a fair game. Both children and ladies really feel the effect of simply a moment?s enjoyment, for the rest of their lives.

Оставить ответ

Ваш адрес email не будет опубликован. Обязательные поля помечены *