This would be better as `[ -n "$pid" ]`