#!/bin/sh cmd="$@" for ep in ep? do ( cd $ep ( echo "toxtcp" ; sed s,^,ping, ../ports.txt ) | ../dht ) done