HW12/bench.sh

18 lines
342 B
Bash
Raw Permalink Normal View History

2020-12-09 00:20:59 +09:00
#! /bin/bash
if [[ ! -d 'tmp' ]]
then
mkdir tmp
fi
cd testdata
../server 2> log.txt > outlog.txt &
server_pid=$!
sleep 1
cd ../tmp
cat ../testdata/dlist.txt|../client localhost 9091 -b -nv -q -t 8
sed -i -E 's/^[A-Za-z:, ]*([0-9]+)[A-Za-z:, ]+([0-9]+).*$/\1,\2/' ../testdata/log.txt
echo turn off server :$server_pid
kill $server_pid