Hi, I'm trying to have MySQL and Redis run on two different ports. Since I want to parallelize builds, I'm using this command to find an unused, unprivileged port:
export MYSQL_PORT=$( (netstat -atn | awk '{printf "%s\n%s\n", $4, $4}' | grep -oE '[0-9]*$'; seq 32768 61000) | sort -n | uniq -u | head -n 1) export REDIS_PORT=$( (netstat -atn | awk '{printf "%s\n%s\n", $4, $4}' | grep -oE '[0-9]*$'; seq 32768 61000) | sort -n | uniq -u | grep -v $MYSQL_PORT | head -n 1) Yet I'm always getting all sorts of : uniq: write error: Broken pipe grep: writing output: Broken pipe I tried running those commands on the machine with the jenkins user, they work perfectly. Any idea? Thanks! Charles