From: Alex Dehnert Date: Fri, 9 Aug 2013 14:08:41 +0000 (-0400) Subject: ldapfinger: set safer shell options X-Git-Url: https://www.dehnerts.com/gitweb/?p=user%2Falex%2Fsoftware%2Fmy-snippets.git;a=commitdiff_plain;h=7abaada1a725c97b76d4a56980d3a4a44411bfad ldapfinger: set safer shell options --- diff --git a/ldapfinger b/ldapfinger index 62a84f4..548769a 100755 --- a/ldapfinger +++ b/ldapfinger @@ -1,10 +1,11 @@ -#!/bin/bash +#!/bin/sh +set -euf for user in "$@"; do echo ldapsearch -x -h ldap.mit.edu -b dc=mit,dc=edu "uid=$user" ldapsearch -x -h ldap.mit.edu -b dc=mit,dc=edu "uid=$user" done -echo Try also athrun consult ldaps -echo or ldapsearch -x -h ldap-too.mit.edu -b ou=moira,dc=mit,dc=edu "uid=$user" +echo Try also athrun consult ldaps or +echo ldapsearch -x -h ldap-too.mit.edu -b ou=moira,dc=mit,dc=edu "uid=${user:-username}"