3 ms·
echo ($(ldap-query-for-valid-users)) > /tmp/all-users.sexp should be something like x=$(ldap-query-for-valid-users); test ${#x} -gt 0||exec echo no va
by 10165 9y ago
echo ($(ldap-query-for-valid-users)) > /tmp/all-users.sexp
should be something like
x=$(ldap-query-for-valid-users);
test ${#x} -gt 0||exec echo no valid users >&2;
echo \("$x"\) > /tmp/all-users.sexp;
This way they would get the message "no valid users" to stderr and the script would exit. According to the blog post that is what they wanted.
Alternatively,
x=$(ldap-query-for-valid-users);
test ${#x} -gt 0||exit 100
echo \("$x"\) > /tmp/all-users.sexp;
if they prefer a nonzero exit code to a message to stderr.