From owner-freebsd-questions@FreeBSD.ORG Thu Jul 28 00:34:16 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B79916A41F for ; Thu, 28 Jul 2005 00:34:16 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E9F643D48 for ; Thu, 28 Jul 2005 00:34:15 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j6S0YDft027805; Wed, 27 Jul 2005 20:34:14 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <1559.192.168.0.10.1122502486.squirrel@192.168.0.5> References: <1559.192.168.0.10.1122502486.squirrel@192.168.0.5> Date: Wed, 27 Jul 2005 20:34:13 -0400 To: martin@orbweavers.co.uk, freebsd-questions@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.4 Cc: Subject: Re: Shell script frustration X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2005 00:34:16 -0000 At 11:14 PM +0100 7/27/05, martin@orbweavers.co.uk 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, >ou=groups,dc=orbweavers,dc=co,dc=uk" >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 "list_args.sh": #!/bin/sh printf "\nlist_args.sh at `date +%H:%M:%S` with \$# = $#\n" # Process all parameters. N=0 while test $# != 0 ; do N=$(($N+1)) printf " \$$N = [%3d] '$1'\n" ${#1} shift done Then in your script, replace the ldapdelete command with list_args.sh. That way you'll see *exactly* what ldapdelete is seeing for parameters, and that might help. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu