source: branches/nemo_v3_3_beta/NEMOGCM/SETTE/all_function.sh @ 2354

Last change on this file since 2354 was 2354, checked in by flavoni, 10 years ago

first draft for SETTE (SET tests for NEMO), a new version of NVTK, see ticket #752

  • Property svn:executable set to *
File size: 525 bytes
Line 
1#!/bin/bash
2# function set_namelist
3# input variable value
4# output namelist
5
6# function to find namelists parameters
7supergrep () {
8            grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
9    }
10
11# USAGE : if you want to add a string with " : ./test var_name \"new_value\"
12# function to set namelists parameters
13set_namelist () {
14     VAR_NAME=$( supergrep $1 ${INPUT_DIR}/namelist )
15     sed -e "s/${VAR_NAME}/$1=$2/"  ${INPUT_DIR}/namelist > ${INPUT_DIR}/namelist.tmp
16     mv ${INPUT_DIR}/namelist.tmp ${INPUT_DIR}/namelist
17}
Note: See TracBrowser for help on using the repository browser.