#!/bin/sh # 查找端口pid if [[ $# == 1 && `netstat -antp|grep $1|wc -l` -eq 1 ]] then netstat -anp|grep $1|awk '{printf $7}'|cut -d/ -f1 fi