2013年2月27日

脚本遍历网络接口提取指定的信息

摘要: #!/bin/sh### show all network interface e.g: eth0 192.168.0.1 255.255.255.0 ###interface="$(ifconfig | grep 'Link encap:Ethernet' | cut -d' ' -f1)"for n in $interfacedo myIp=$(ifconfig $n | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{pr 阅读全文

posted @ 2013-02-27 23:00 流川仙道 阅读(194) 评论(0) 推荐(0) 编辑

scp或者tftp自动拷贝远端文件的脚本

摘要: linux的scp命令顾名思义就是拷贝文件,跟cp命令差不多,但是scp可以实现远端文件的拷贝,在CLI下面使用scp后会提示输入密码,下面使用脚本可以自动输入密码,如下 1 #!/bin/sh 2 ### input parms #### 3 # scp.sh <remoteIp> <remoteUser> <remoteFilePath> <localFilePath> <remotePasswd> 4 5 if [ "$#" -eq "5" ] ; then 6 echo "in 阅读全文

posted @ 2013-02-27 22:37 流川仙道 阅读(496) 评论(0) 推荐(0) 编辑

导航