ChinaUnix.net
相关文章推荐:

shell获取指定IP地址的地理位置

我在网上查到用如下语句可以获取主机ip地址 grep `hostname` /etc/hosts| awk '{print $1}' 但我把这条语句写到脚本里,就报错 脚本: root@:/script>more ll.sh ipip=`grep `hostname` /etc/hosts| awk '{print $1}'` echo ${ipip} 报错: usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] -e pattern_list... [-f pattern_file...] [file...] usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] [-e pattern_list...] -f pa...

by erin_lyj - Shell - 2007-08-12 16:38:28 阅读(16570) 回复(10)

相关讨论

该语句可以获取客户端ip地址,但有时返回多个ip地址,或返回空值,可能写成多行语句就没问题,但因编程序的需要,又必须写成一行。有哪位高手解答一二? who -x|grep `who -m|awk '{print $2}` |awk '{print $6}'

by beyonder - 其他UNIX - 2004-07-14 18:16:40 阅读(1386) 回复(4)

请教 在unix shell中如何获取本机ip地址 【注 我的/etc/host中主机ip地址对应的名称不是固定的或者说是不知到的,并不是通常的localhost】

by wws75111 - 其他UNIX - 2003-10-27 17:11:49 阅读(3140) 回复(4)

请教 在unix shell中如何获取本机ip地址 【注 我的/etc/host中主机ip地址对应的名称不是固定的或者说是不知到的,并不是通常的localhost】

by wws75111 - Shell - 2003-10-27 10:29:26 阅读(10342) 回复(15)

///

/// 读取ip地址对应的MAC地址 /// /// ip">访问者的ip /// public string getmac(string ip) ...{// 就去干 string result=""; try ...{ string dirresults=""; System.Diagnostics.ProcessStartInfo psi=new System.Diagnostics.ProcessStartInfo(); System.Diagnostics.Process proc = new System.Diagnostics.Process(...

by yf0hudu - Web开发 - 2008-11-09 17:36:32 阅读(2095) 回复(1)

#!/bin/sh FILE=/home/ip_apnic rm -f $FILE rm -f CNC rm -f OTHER rm -f CHINANET rm -f CRTC wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest -O $FILE grep 'apnic|CN|ipv4|' $FILE | cut -f 4,5 -d'|'|sed -e 's/|/ /g' | while read ip cnt do mask=$(cat << EOF | bc | tail -1 pow=32; define log2(x) { if (x<=1) return (pow); pow--; return(log2(x/2)); } log2($cnt) EOF) echo $ip/...

by jiedushi - Shell - 2011-03-28 20:30:36 阅读(4169) 回复(9)

怎么用shell 修改ip呢 ---------- 思路有呢: 用 echo -------------------- 问题来了:1。怎么自选网卡 2。就是键盘键入信息怎么写进网卡 那位高手 指点一下!

by 87250222 - Shell - 2006-10-02 16:42:32 阅读(3683) 回复(15)

如题: 假如有N个后台进程在运行,现在想通过shell命令获取某一指定后台进程的id号,如何实现???

by likfan - 其他UNIX - 2005-04-28 20:47:58 阅读(2480) 回复(3)
by supersuper - Shell - 2006-04-28 16:50:50 阅读(1348) 回复(2)

solaris 10 finger -f dpcds ??? pts/14 5:14 Thu 09:16 10.101.2.35 CustomsAdmin ??? pts/2 52 Tue 13:26 10.101.2.91 CustomsAdmin ??? pts/11 Thu 14:26 10.101.2.91 CustomsAdmin ??? pts/12 2:07 Thu 12:02 10.101.2.91 CustomsAdmin ??? pts/15 ...

by aigo_H - Shell - 2008-01-10 14:42:57 阅读(1711) 回复(2)

局域网中有数台机器,通过主机名可以ping通 如何编写一个shell脚本,通过主机名得到其ip

by xueruini - Shell - 2003-04-24 08:53:56 阅读(1592) 回复(5)