Shell script frustration

Garance A Drosihn drosih at
Thu Jul 28 00:34:16 GMT 2005

At 11:14 PM +0100 7/27/05, martin at wrote:
>echo ldapdelete -W -D $binddn \"cn=$1, $group_base\"
>ldapdelete -W -D $binddn \"cn=$1, $group_base\"

>when run ('./rmgroup users') it outputs -
>ldapdelete -W -D "cn=Manager,dc=orbweavers,dc=co,dc=uk" "cn=users,
>Enter LDAP Password:
>ldap_bind: Invalid DN syntax (34)
>         additional info: invalid DN
>However, if I copy and paste the echod statement (the first line
>of the output) straight to the shell, it run fine.

What I do in this cases is create a script called "":

printf "\ at `date +%H:%M:%S` with \$# = $#\n"
# Process all parameters.
while test $# != 0 ; do
     printf "    \$$N = [%3d] '$1'\n" ${#1}

Then in your script, replace the ldapdelete command with  That way you'll see *exactly* what ldapdelete
is seeing for parameters, and that might help.

Garance Alistair Drosehn            =   gad at
Senior Systems Programmer           or  gad at
Rensselaer Polytechnic Institute    or  drosih at

More information about the freebsd-questions mailing list