Commit ec14a4df authored by zauberstuhl's avatar zauberstuhl
Browse files

Trim all whitespaces from sql count output

parent d383cc54
......@@ -18,7 +18,7 @@ psqlCount="$psql -q -c 'select count(*) from testtable;'"
$psql -c 'create table if not exists testtable(id serial primary key);' || exit 1
while true; do
cnt=$(eval $psqlCount |head -3 |tail -n 1)
cnt=$(eval $psqlCount |head -3 |tail -n 1 |tr -d '[:space:]')
req=$(echo -e "HTTP/1.1 200 OK\n\n$cnt" | nc -c -l -p $PORT
if [[ $req =~ '/add' ]]; then
eval $psqlAdd
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment