4
$ cat mass_insert.txt
*3
$3
SET
$4
key1
$6
value1
*3
$3
SET
$4
key2
$6
value2
$ cat mass_insert.txt | nc localhost 6379
如果你看到,我在一個文件mass_insert.text
大衆插入Redis命令,我把它cat
到的netcat和指令被髮送到精細的Redis但反應不傾倒。問題是爲什麼?爲什麼netcat不會轉儲響應?
與netcat
簡單google.com
HEAD請求的作品就好了,即,轉儲的響應 -
$ printf "HEAD/HTTP/1.0\r\n\r\n" | nc google.com 80
HTTP/1.0 302 Found
Location: http://www.google.co.in/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=cac6fac8de9b5d0c:FF=0:TM=1365352115:LM=1365352115:S=CVuSzOK8mrsfFczI; expires=Tue, 07-Apr-2015 16:28:35 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=K5KjAFxuDP5epZKDdvSf4oCe4FRP1AL8LG_9MEdsArn4Oz_UBG69H0KOMUiKLuVN-hH4NIUvHOLgmfh_82P5v6Nh-sGFrGXyCnQz0zD-Sj_QbzxQ6NIK0rahsxjvyTn7; expires=Mon, 07-Oct-2013 16:28:35 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Date: Sun, 07 Apr 2013 16:28:35 GMT
Server: gws
Content-Length: 221
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
什麼輸出添加'-vv'到你的NC命令給你?在運行你的nc命令後,'echo $?'是什麼意思? – craig65535 2013-04-08 00:53:48
http://pastie.org/7360305 – user1437328 2013-04-08 04:10:25
'nc -h'給你什麼版本? (第一行輸出) – craig65535 2013-04-08 04:44:57