Hi,
thanks for make duma!
I've started evaluating duma for some issues I've been having. While building and trying out on my Fedora system, I identified a few tweaks for duma.sh, just from my experience in shell programming:
- duma.sh doesn't require #!/bin/bash for the syntax it's using, I recommend the more generic #!/bin/sh.
- to check for no arguments given, the standard shell way is
if [ $# -lt 1 ]; then
and not
if [ "$1" = "" ]; then
- in the usage case where no argument is given, I think it is valid to exit with an error:
exit 1
instead of
exit
- the environment and exec doesn't require to be encapsulated in brackets, this spawns an extra shell
- exec $*
is not the correct way to process further arguments, it will break program executions which get arguments which contain spaces. The correct handling is:
exec "$@"
A patch for all these suggestions is attached. I have yet to find a program which I can successfully debug with duma though. ;-) (I have one which ends in an illegal instruction, and did the same under gdb.)
patch for duma.sh implementing my suggestions