代码: 全选
1 #!/bin/bash
2 #Program:
3 # This program shows using netstat and grep to detect WWW,SSHH,FTP,and Mail services ports
4 #History:
5 #2013/05/04 13:48 yan ninth release
6
7 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
8 export PTAH
9
10 testing=$ (netstat -tuln | grep ":80 ")
11 if [ "$testing" != "" ];
12 then
13 echo "WWW is running in your system"
14 fi
15 testing=$ (netstat -tuln | grep ":22 ")
16 if [ "$testing" != "" ];
17 then
18 echo "SSH is running in your system"
19 fi
20 testing=$ (netstat -tuln | grep ":21 ")
21 if [ "$testing" != "" ];
22 then
23 echo "FTP is running in your system"
24 fi
25 testing=$ (netstat -tuln | grep ":25 ")
26 if [ "$testing" != "" ];
27 then
28 echo "Mail is running in your system"
29 fi
想问问 第10行那个括号里的语法错了吗?我对着书写的说
错误的提示是这样的:
sh09.sh: line 10: syntax error near unexpected token `('
sh09.sh: line 10: `testing=$ (netstat -tuln | grep ":80 ")'
求高手帮忙, 要如何修改
