File mttroot/mtt/bin/trans/dir2rep artifact bcbf36eab2 part of check-in 4e927073f2


#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: dir2rep
# Creates a rep file for a directory

# P.J.Gawthrop Dec 1997
# Copyright (c) P.J.Gawthrop, 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
###############################################################



# Inform user
echo "Creating $1_rep.txt (Directory version)"

# Headings
echo "% Verbal description for directory $1 ($1_rep.txt)"> $1_rep.txt
echo "% Generated by MTT on" `date`. >> $1_rep.txt                  	   

# Create paths for all valid examples - ie dir name is system name
find $1 -name '*_abg.fig' -print | sort |\
  awk '{
   N=split($1,name,"/"); 
   printf("%s", name[1]);
   for (i=2;i<N;i++) printf("/%s", name[i]); 
   printf(" %s %s\n", name[N-1], name[N]);
  }' |\
  awk '{
  correctname=sprintf("%s_abg.fig", $2);
  if ($3==correctname) print "mtt -t -d " $1,$2 " rep tex";
  }' >> $1_rep.txt


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]