---
title: "Socket挡板脚本"
author: "button"
date: "2014-02-21T10:44:08Z"
tags: []
categories: ["操作系统"]
slug: "socket"
draft: false
lastmod: "2014-02-21T10:44:50Z"
id: 2020095
url: "https://jic.iteye.com/blog/2020095"
---

说明：  监听8888端口，当收到socket报文时向9999端口发送baowen.xml文件中的报文

 

//dangban.sh

#!/bin/bash

trap "exit" INT

while true; do netcat -lp 8888 ; netcat localhost 9999 &lt;baowen.xml ; done;