《Disney +》 迪士尼、Marvel、彼思、星球大戰…  Viu 緊貼日本播放《鬼滅之刃 遊郭篇》   LoL與UNIQLO「UT」合作!《英雄聯盟》UT日本開始販售!   「明星大亂鬥特別版 最後之特別番組」就是「索拉的使用方法」!發表內容總結!   hololive 1期生 時乃空在2022年1月22日(四)舉辦演唱會 Theatrical Cover Live「Role:Play」!   大人氣的Bauhutte電競椅進化!2種不同質料的「Gaming Sofa Chair 2」登場!   《Ghost of Tsushima》即將改編電影   原神2.1版本更新:在提瓦特世界和亞蘿伊一起狩獵吧!   《對馬戰鬼》《魔物獵人崛起》同獲日本遊戲大賞2021年度首獎! 

nc 如何 STDIN 結束就關閉

商業

使用 nc 連接 socket 端,就會一直咬在那邊,但是想要命令執行完成就結束,該怎麼做呢?

nc 如何 STDIN 結束就關閉

nc 可以靠下述兩個參數來達成:

  • -q seconds after EOF on stdin, wait the specified number of seconds and then quit. If seconds is negative, wait forever.
  • -w secs timeout for connects and final net reads

範例

  • echo "test" | nc -q 1 localhost 11211
  • echo "test" | nc -w 3 localhost 11211

相關網頁

Tsung

隨機商業新聞

Disney Plus