Last change
on this file since 3897 was
3847,
checked in by ymipsl, 9 years ago
|
Add IOIPSL in the configuration.
Temporary configuration.
Makefile is ready for Curie
YM
|
-
Property svn:executable set to
*
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/bin/ksh |
---|
2 | # $Header$ |
---|
3 | #--------------------------------------------------------------------- |
---|
4 | # @(#)Rebuild IOIPSL domains |
---|
5 | #--------------------------------------------------------------------- |
---|
6 | #- |
---|
7 | #set -xv |
---|
8 | #- |
---|
9 | # Extract the calling sequence for the script (d_n/b_n) |
---|
10 | #- |
---|
11 | d_n=$(dirname $0); b_n=$(basename $0); |
---|
12 | #- |
---|
13 | # Retrieving and validation of the options |
---|
14 | #- |
---|
15 | r_v='silencious'; r_o=""; |
---|
16 | while getopts :hvo: V |
---|
17 | do |
---|
18 | case $V in |
---|
19 | (h) echo ''; |
---|
20 | echo ${b_n} 'rebuild a model_file from several input files.'; |
---|
21 | echo 'Each input file contains the model_data for a domain.'; |
---|
22 | echo 'Usage :'; |
---|
23 | echo ${b_n} '[-h]'; |
---|
24 | echo ${b_n} '[-v] -o output_file_name list_of_input_file_names'; |
---|
25 | echo ' -h : this help'; |
---|
26 | echo ' -v : verbose mode'; |
---|
27 | echo ''; |
---|
28 | exit 0;; |
---|
29 | (v) r_v='verbose';; |
---|
30 | (o) r_o=${OPTARG};; |
---|
31 | (:) echo ${b_n}" : option $OPTARG : missing value" 1>&2; |
---|
32 | exit 2;; |
---|
33 | (\?) echo ${b_n}" : option $OPTARG : not supported" 1>&2; |
---|
34 | exit 2;; |
---|
35 | esac |
---|
36 | done |
---|
37 | shift $(($OPTIND-1)); |
---|
38 | #- |
---|
39 | # Check for the output file |
---|
40 | if [ '\?'${r_o} = '\?' ]; then |
---|
41 | echo ${b_n}' : output_file_name not specified. (Use -h)' 1>&2; |
---|
42 | exit 3; |
---|
43 | fi; |
---|
44 | #- |
---|
45 | #- |
---|
46 | # Validate the number of arguments |
---|
47 | #- |
---|
48 | if [ ${#} -lt 1 ]; then |
---|
49 | echo ${b_n}' : Too few arguments have been specified. (Use -h)' 1>&2; |
---|
50 | exit 3; |
---|
51 | fi |
---|
52 | #- |
---|
53 | # Validate the names of the input files |
---|
54 | #- |
---|
55 | qi=0; |
---|
56 | for i in $*; |
---|
57 | do ((qi=qi+1)); |
---|
58 | [ ${qi} -le ${#} ] && [ ! -f ${i} ] && \ |
---|
59 | { echo "${i} unreachable ..."; exit 3;} |
---|
60 | done |
---|
61 | #- |
---|
62 | # Create the information file for the program |
---|
63 | #- |
---|
64 | echo ${r_v} > tmp.$$; |
---|
65 | ((qi=$#+1)); |
---|
66 | echo ${qi} >> tmp.$$; |
---|
67 | for i in $*; |
---|
68 | do echo ${i} >> tmp.$$; |
---|
69 | done |
---|
70 | echo ${r_o} >> tmp.$$; |
---|
71 | #- |
---|
72 | # Create the output file |
---|
73 | #- |
---|
74 | ${d_n}/flio_rbld < tmp.$$ |
---|
75 | #- |
---|
76 | # Clear |
---|
77 | #- |
---|
78 | rm -f tmp.$$ |
---|
79 | #- |
---|
80 | # End |
---|
81 | #- |
---|
82 | exit 0; |
---|
Note: See
TracBrowser
for help on using the repository browser.