At 10:10 AM +0100 7/28/05, [EMAIL PROTECTED] wrote:
Garance wrote:
 > 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.

I tried that one, with an echo $* - though I assume the printf
prints it out 'more precise'?

Well, I also have versions that use an echo instead of printf.
The printf just makes it easier to have a "pretty" output.

The problem with using a plain 'echo *' is that there are
several different inputs which will produce the same output.

Compare:
        echo a b
    and echo "a b"
or      echo "a b"
    and echo "a b "

The outputs from `echo' will look the same, but the arguments to
the program are very different.  That's why my script lists out
the exact arguments, with their lengths.  I did that because
sometimes those details matter.  I have solved problems similar
to the one which is frustrating you by using this kind of script.

--
Garance Alistair Drosehn     =      [EMAIL PROTECTED]
Senior Systems Programmer               or   [EMAIL PROTECTED]
Rensselaer Polytechnic Institute;             Troy, NY;  USA
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to