#!/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]-->