summaryrefslogtreecommitdiff
path: root/lib/make/CCTK_Functions.sh
blob: 145c3af1b9a040efa048f655d8d5f3d679b63405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
65
66
#! /bin/sh
# /*@@
#   @file      CCTK_Functions.sh
#   @date      Wed Jul 21 11:16:06 1999
#   @author    Tom Goodale
#   @desc 
#   
#   @enddesc 
#   @version $Header$
#
# @@*/


# /*@@
#   @routine    CCTK_Search
#   @date       Wed Jul 21 11:16:35 1999
#   @author     Tom Goodale
#   @desc 
#   Used to search for something in various directories
#   @enddesc 
#   @calls     
#   @calledby   
#   @history 
# 
#   @endhistory 
#
#@@*/

CCTK_Search()
{
  eval  $1=""
  if test $# -lt 4 ; then
    cctk_basedir=""
  else
    cctk_basedir="$4/"
  fi
  for cctk_place in $2  
    do
      echo $ac_n "Looking in $cctk_place""...$ac_c" #1>&6
      if test -r "$cctk_basedir$cctk_place/$3" ; then
        echo "$ac_t""...Found" #1>&6
        eval $1="$cctk_place"
        break
      fi
      if test -d "$cctk_basedir$cctk_place/$3" ; then
        echo "$ac_t""...Found" #1>&6
        eval $1="$cctk_place"
        break
      fi
      echo "$ac_t""No" #1>&6
    done

  return
}

CCTK_CreateFile()
{
  echo $2 > $1
  return
}

CCTK_WriteLine()
{
  echo $2 >> $1
  return
}