lib/Tools/findlogics
author blanchet
Wed May 21 14:09:42 2014 +0200 (2014-05-21)
changeset 57037 c51132be8e16
parent 33915 44a10fe6bd10
child 57414 fe1be2844fda
permissions -rwxr-xr-x
avoid markup-generating @{make_string}
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Markus Wenzel, TU Muenchen
     4 #
     5 # DESCRIPTION: collect heap names from ISABELLE_PATH
     6 
     7 
     8 PRG=$(basename "$0")
     9 
    10 function usage()
    11 {
    12   echo
    13   echo "Usage: isabelle $PRG"
    14   echo
    15   echo "  Collect heap file names from ISABELLE_PATH."
    16   echo
    17   exit 1
    18 }
    19 
    20 
    21 ## main
    22 
    23 [ "$#" -ne 0 ] && usage
    24 
    25 declare -a LOGICS=()
    26 declare -a ISABELLE_PATHS=()
    27 
    28 splitarray ":" "$ISABELLE_PATH"; ISABELLE_PATHS=("${SPLITARRAY[@]}")
    29 
    30 for DIR in "${ISABELLE_PATHS[@]}"
    31 do
    32   DIR="$DIR/$ML_IDENTIFIER"
    33   for FILE in "$DIR"/*
    34   do
    35     if [ -f "$FILE" ]; then
    36       NAME=$(basename "$FILE")
    37       LOGICS["${#LOGICS[@]}"]="$NAME"
    38     fi
    39   done
    40 done
    41 
    42 echo $({ for L in "${LOGICS[@]}"; do echo "$L"; done; } | sort | uniq)