Skip to contentSkip to conversation

finger01: fix grep command

PATCH In review Simon Xu 2 participants 2 messages Mar 26, 2014

lore
Share & tools
lore

Simon Xu

author
#0 lore raw

PATCH 1/1 finger01: fix grep command

'grep "*:finger"' doesn't work with netstat output such as:

tcp6 0 0 [::]:finger [::]:* LISTEN

Use 'grep ":finger"' which always works.

---
 testcases/network/tcp_cmds/finger/finger01 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/network/tcp_cmds/finger/finger01 +2 -2
index 81da3e0..203d746 100755
@@ -61,12 +61,12 @@ do_setup()
 
     [ "$LUSER" = "root" ] || end_testcase "MUST BE root to run the test!"
 
-    FINGER=$(netstat -a | grep "*:finger" |awk '{print $6}')
+    FINGER=$(netstat -a | grep ":finger" |awk '{print $6}')
     if [ "$FINGER" != "LISTEN" ]; then
         end_testcase "Please start fingerd locally."
     fi
 
-    FINGER=$(rsh -n $RHOST netstat -a |grep "*:finger"|awk '{print $6}')
+    FINGER=$(rsh -n $RHOST netstat -a |grep ":finger"|awk '{print $6}')
     if [ "$FINGER" != "LISTEN" ]; then
         end_testcase "Please start fingerd on remote host."
     fi
Signature · 13 lines
1.8.5.4


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 5 lines

'grep "*:finger"' doesn't work with netstat output such as:

tcp6 0 0 [::]:finger [::]:* LISTEN

Use 'grep ":finger"' which always works.

Pushed, thanks.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list