zjisteni IP adresy v shell-scriptu
Tom Hudec
Tom na ABBA.cz
Úterý Duben 2 23:35:43 CEST 2002
Ladislav Kepsta wrote:
> ifconfig eth0|grep ask|awk '{print $2}'|cut -d ':' -f2
Proc hned spoustet tolik programu (grep, awk, cut)?
ifconfig eth0 | sed -n '/inet/s/[^:]*:\([0-9.]*\).*/\1/p'
Hana Skoumalova wrote:
> ifconfig -a | grep --after-context=1 hme0 | tail -1 | tr -d '\t' \
> | cut -f2 -d" "
Nebo dokonce 4 dalsi...
ifconfig hme0 | sed -n '/inet/s/[^ ]* \([0-9.]*\).*/\1/p'
--
Tom Hudec <Tom(at)ABBA.cz>, editor of Tom's ABBA pages http://ABBA.cz/
.''`. The box said Windows, NT or better, so I installed Linux. :-)
: :' :
`. `' Debian GNU/Linux http://www.debian.org/ http://www.debian.cz/
`- The Perfect OS - the most software, the most people
Další informace o konferenci Linux