source: branches/NERC/dev_r5518_GO6_CO2_cmip/NEMOGCM/TOOLS/COMPILE/Fread_dir.sh @ 9298

Last change on this file since 9298 was 6486, checked in by davestorkey, 5 years ago

Remove SVN keywords from UKMO/dev_r5518_GO6_package branch.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2#set -x
3set -o posix
4#set -u
5#set -e
6#+
7#
8# ============
9# Fread_dir.sh
10# ============
11#
12# ---------------------
13# Read user directories
14# ---------------------
15#
16# SYNOPSIS
17# ========
18#
19# ::
20#
21#  $ Fread_dir.sh
22#
23#
24# DESCRIPTION
25# ===========
26#
27#
28# Read directoires needed from standard input
29#
30# EXAMPLES
31# ========
32#
33# ::
34#
35#  $ ./Fread_dir.sh Directory_NAME YES/NO
36#
37#
38# TODO
39# ====
40#
41# option debug
42#
43#
44# EVOLUTIONS
45# ==========
46#
47# $Id: Fread_dir.sh 3294 2012-01-28 16:44:18Z rblod $
48#
49#
50#
51#   * creation
52#
53#-
54
55if [ "$2" == "YES" ]; then
56   echo -n " $1 [Y/n] "
57   read answer
58   answer=`echo $answer | sed 's/^[yY].*$/y/'`
59   if [  -z "$answer" -o "x$answer" = "xy" ]; then
60      TAB[$ind]="$1"
61      let ind=ind+1
62      echo " $1 selected "
63      echo "  "
64   else
65      echo " $1 Not selected "
66      echo "  "
67   fi
68   unset -v answer
69else
70   echo -n " $1 [y/N] "
71   read answer
72   answer=`echo $answer | sed 's/^[nN].*$/N/'`
73   if [ "x$answer" = "xy" ]; then
74      TAB[$ind]="$1"
75      let ind=ind+1
76      echo " $1 selected "
77      echo "  "
78   else
79      echo " $1 Not selected "
80      echo "  "
81   fi
82   unset -v answer
83fi
Note: See TracBrowser for help on using the repository browser.