用shell script檢查IP問題 - Linux

By Sarah
at 2008-07-11T11:51
at 2008-07-11T11:51
Table of Contents
我現在能把一個檔案的IP取出了
但是現在想問的是,有辦法鎖定某個範圍內的IP通過測試嗎?
例如
192.168.1.200~230這樣子的IP列出
其他都當作沒看到
我嘗試使用
if[ $i != "192.168.1.19[0-9]" ]
這樣可以(表示19x的過濾掉)
然而這樣子
if[ $i != "192.168.1.2[0-9]{2}" ]
卻沒辦法
我希望能讓他200~230都顯示出來有什麼辦法呢?
(上面的寫法是200~254都OK..但我的範圍不要這麼大)
煩請高手指導@@
謝謝
--
▊ ◥ thePainter. ◤ ▎
▊ ◣◢ ◣ ◤ ◣ ◤ ▎
▊ ◥◤ ◣ ◤ ◤ ▎ http://www.wretch.cc/blog/myelf
▊ ◥ ◢ ◤ ◤ ◤ ▎ Wretch@BBS -> P_myelf
▊ ◢◤ thePainter. ◣ ▎ φthePainter.
--
但是現在想問的是,有辦法鎖定某個範圍內的IP通過測試嗎?
例如
192.168.1.200~230這樣子的IP列出
其他都當作沒看到
我嘗試使用
if[ $i != "192.168.1.19[0-9]" ]
這樣可以(表示19x的過濾掉)
然而這樣子
if[ $i != "192.168.1.2[0-9]{2}" ]
卻沒辦法
我希望能讓他200~230都顯示出來有什麼辦法呢?
(上面的寫法是200~254都OK..但我的範圍不要這麼大)
煩請高手指導@@
謝謝
--
▊ ◥ thePainter. ◤ ▎
▊ ◣◢ ◣ ◤ ◣ ◤ ▎
▊ ◥◤ ◣ ◤ ◤ ▎ http://www.wretch.cc/blog/myelf
▊ ◥ ◢ ◤ ◤ ◤ ▎ Wretch@BBS -> P_myelf
▊ ◢◤ thePainter. ◣ ▎ φthePainter.
--
Tags:
Linux
All Comments
Related Posts
請問如何將make所編譯到的檔案名,輸出 …

By Andrew
at 2008-07-11T11:39
at 2008-07-11T11:39
音效卡一問

By Regina
at 2008-07-11T11:21
at 2008-07-11T11:21
拖動視窗會留下殘影

By Zanna
at 2008-07-11T10:09
at 2008-07-11T10:09
請問如何將make所編譯到的檔案,輸出成一個文件

By Robert
at 2008-07-11T08:57
at 2008-07-11T08:57
vsftpd問題(容易斷線)

By Delia
at 2008-07-11T02:13
at 2008-07-11T02:13