Overview
Comment:Fixed awk prob - must be the same sep. for each field (?)
So tr tab to space
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 10392f79482dddc5d9fe5f66f6d40bc8649fe3e2d8b132764f09ecf82f58c819
User & Date: gawthrop@users.sourceforge.net on 2000-04-04 16:15:14.000
Other Links: branch diff | manifest | tags
Context
2000-04-05
07:37:27
*** empty log message *** check-in: 8debb765ca user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2000-04-04
16:15:14
Fixed awk prob - must be the same sep. for each field (?)
So tr tab to space
check-in: 10392f7948 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:14:08
Sorted mtt help check-in: c4fe55a67e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes
1
2
3
4
5
6
7
8
9
10
11



12
13
14
15
16
17
18
#! /bin/sh

# mtt2reps_txt: Gives a tabular listing of representations and languages
# P J Gawthrop July 1998, October 1998
# Copyright (c) P.J.Gawthrop, 1998

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



## Revision 1.5  2000/01/19 17:26:12  peterg
## Now includes the representation title.
##
## Revision 1.4  1999/03/09 00:03:06  peterg
## Revisions for xmtt
##
## Revision 1.3  1999/03/08 21:24:43  peterg











>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh

# mtt2reps_txt: Gives a tabular listing of representations and languages
# P J Gawthrop July 1998, October 1998
# Copyright (c) P.J.Gawthrop, 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.6  2000/04/04 13:09:51  peterg
## *** empty log message ***
##
## Revision 1.5  2000/01/19 17:26:12  peterg
## Now includes the representation title.
##
## Revision 1.4  1999/03/09 00:03:06  peterg
## Revisions for xmtt
##
## Revision 1.3  1999/03/08 21:24:43  peterg
︙︙
29
30
31
32
33
34
35
36
37


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
##
###############################################################


representations=`grep '#SUMMARY' $MTTPATH/mtt | awk '{print $2'} | sort -u `

for rep in $representations ; do
    ## Title should be same for all languages -- extract from first version
    title=`grep '#SUMMARY' $MTTPATH/mtt | grep " $rep[ \*]" | head -1 | \


      awk '{for (i=3;i<NF;i++) print $i}'`

    language=`grep '#SUMMARY' $MTTPATH/mtt |\
      awk '
        {
          if (index(rep,"*")==length(rep)){
            if ($2==rep) print $NF
          }
          else
            if (($2==rep)||($2==sprintf("%s*",rep))) print $NF
        }' rep=$rep |\
      sort -u | sed 's/[()]//g'` 

      Title='('$title')'
      echo $rep $Title $language
     

    #   awk '{
    #     printf( "%s", $1)
    #     for (i=2;i<=NF;i++) printf("\t%s", $i); 
    #     printf("\n")
    #   }'
done











|
|
>
>
|















<
<
<
<
<
<





32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58






59
60
61
62
63
##
###############################################################


representations=`grep '#SUMMARY' $MTTPATH/mtt | awk '{print $2'} | sort -u `

for rep in $representations ; do
    ## Title should be same for all languages -- but extract the first non-empty version
      title=`grep '#SUMMARY' $MTTPATH/mtt | tr '\t' ' ' | grep "$rep[ *]" | \
      awk  '{if (NF>2) {for (i=3;i<NF-1;i++) printf("%s ",$i); NF1=NF-1; printf("%s\n",$NF1)}}' |\
      head -1`
      

    language=`grep '#SUMMARY' $MTTPATH/mtt |\
      awk '
        {
          if (index(rep,"*")==length(rep)){
            if ($2==rep) print $NF
          }
          else
            if (($2==rep)||($2==sprintf("%s*",rep))) print $NF
        }' rep=$rep |\
      sort -u | sed 's/[()]//g'` 

      Title='('$title')'
      echo $rep $Title $language
     






done





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