歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux基礎知識 >> 在Linux系統上給Windows發送PopUp消息

在Linux系統上給Windows發送PopUp消息

日期:2017/3/2 14:47:38   编辑:Linux基礎知識
把下面腳本保存為/usr/local/bin/net:
 
  
#!/bin/bash

#/usr/local/bin/net

case “$1” in

send)

echo “$3”|smbclIEnt -I “$2” -M `nmblookup -A “$2”|sed -e ‘1d’ 

-e ‘3,/*/d’|cut -f2|cut -d‘ ’ -f1`

;;

*)

echo “Usage:net send <IPaddr.> <message>”

exit 1

esac


 
  再給該文件加上執行權限,命令如下:
 
  

#chmod +x /usr/local/bin/net

 
  使用net腳本的例子如下:
 
  

#net send 192.168.12.1 "hello, Linux!" 
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

 
Copyright © Linux教程網 All Rights Reserved