---
title: "linux下tcp服务器简单测试脚本"
author: "becomeBetter"
date: "2016-09-22T19:59:36Z"
tags: ["localhost", "nc", "shell"]
categories: ["编程语言"]
slug: "linux-tcp"
draft: false
lastmod: "2016-09-22T19:59:36Z"
id: 2326320
url: "https://becomebetter.iteye.com/blog/2326320"
---

#!/bin/bash

myvar=1

while \[ $myvar -le 800 ]

do

        echo $myvar

        #echo -n "------------" | nc localhost 9999 &

nc localhost 9999 &lt; post&

sleep 0.02

 myvar=$(( $myvar + 1 ))

done