--- ../2004-02-24-07/chkmadd 2004-02-25 02:27:58.000000000 +0100 +++ chkmadd 2004-03-01 17:38:52.000000000 +0100 @@ -1,6 +1,6 @@ - #!/bin/bash + #!/bin/sh appname=`basename "$0" 2>/dev/null || echo "$0"` - ver='0.1.2.2004022407' + ver='0.1.2.2004030117' copy='2003, 2004' mail='mehl@PointedEars.de' mail_feedback='chkmadd@PointedEars.de' @@ -44,7 +44,7 @@ latest_uri='http://PointedEars.de.vu/too # TO DO (0.1.2RC1) # ================= # - # * POSIX conform parsing of options and arguments + # * Be IRIX 6.5 compatible # * Avoid checking duplicate hosts (same IPv4 address) by default; # allow to override with -f option # @@ -131,7 +131,7 @@ to prevent that. echo "So you should either use the -a option or specify the correct path." } - echo -e "\ + echo "\ ${extd}-V${norm}, ${extd}--version${norm} Display version information\ and exit. @@ -338,27 +339,26 @@ bugs_info () } test $show_version -eq 0 && bugs_info - addresses=() j=0 - test -n "$1" && { + if [ -n "$1" ]; then for i in $* do - i=${i##<} - addresses[$j]=${i%%>} - let j++ + i=${i##\<} + addresses[$j]=${i%%\>} + let j=$j+1 done - } || test -n "$file" && { + elif [ -n "$file" ]; then test "$file" = "-" && file=/dev/stdin while read i do - i=${i##<} - addresses[$j]=${i%%>} - let j++ + i=${i##\<} + addresses[$j]=${i%%\>} + let j=$j+1 done < $file # TODO: Should we return $E_ERROR and show help screen if no addresses are read? # test ${#addresses[@]} -eq 0 && help=1 test "$file" = "/dev/stdin" && echo - } + fi test $help -eq 1 -o $show_version -eq 1 && { test $show_version -eq 0 && _help $appname @@ -434,7 +434,7 @@ do fi echo "${mxs}" - hosts=() + hosts= for j in ${mxs} do hosts[${#hosts[@]}]=`echo $j |