[m-rev.] for review: use sed in tools/binary

Peter Wang novalazy at gmail.com
Thu Jun 12 13:09:51 AEST 2008


On 2008-06-12, Peter Wang <novalazy at gmail.com> wrote:
> On 2008-06-12, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
> > On 12-Jun-2008, Peter Wang <novalazy at gmail.com> wrote:
> > > tools/binary:
> > > 	Replace use of non-standard `sub' utility by `sed'.
> > 
> > Actually, it would be simpler to loop over the list and use "basename".
> 
> I wasn't sure if basename is POSIX.

Not that it matters for this utility.  I committed this instead.

Branches: main

tools/binary:
	Replace use of non-standard `sub' utility by `basename'.

Index: tools/binary
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/tools/binary,v
retrieving revision 1.31
diff -u -r1.31 binary
--- tools/binary	30 May 2008 02:04:51 -0000	1.31
+++ tools/binary	12 Jun 2008 02:57:49 -0000
@@ -520,7 +520,10 @@
 if test "$allmodules" = ""
 then
     cd stage2/$testeddir
-    allmodules=`sub X.c X *.c`
+    for module in *.c
+    do
+        allmodules="$allmodules `basename $module .c`"
+    done
     cd $root
 else
     for module in $allmodules

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list