Tidy up the shell scripts somewhat.
[cfd] / mdw-setup
index ab62f09..e4513e0 100755 (executable)
--- a/mdw-setup
+++ b/mdw-setup
@@ -29,7 +29,7 @@ set -e
 ###--------------------------------------------------------------------------
 ### Basic setup stuff.
 
-ego=$(echo "$0" | sed 's:^.*[/\\]::; s:\.*$::')
+ego=${0##*[/\\]}; ego=${ego%%.*}
 usage="Usage: $ego"
 
 ###--------------------------------------------------------------------------
@@ -78,7 +78,7 @@ done
 if [ "$configure" ]; then
   grep >/dev/null AM_PROG_LIBTOOL $configure && libtoolize -f
   find . -name Makefile.m4 -print | while read m4; do
-    dir=$(echo $m4 | sed 's:/[^/]*$::')
+    dir=${m4%/*}
     (cd $dir &&
      m4 Makefile.m4 >Makefile.am.new &&
      mv Makefile.am.new Makefile.am)