Skip to content
Snippets Groups Projects
Commit 70d2d831 authored by Andrew Coward's avatar Andrew Coward
Browse files

Merge branch '125-enhanced-robustness-of-the-sette-namelist-file-customization' into 'branch_4.2'

Resolve "Enhanced robustness of the SETTE namelist-file customization"

See merge request nemo/nemo!192
parents cc7f8410 10b07e63
No related branches found
No related tags found
No related merge requests found
......@@ -292,7 +292,8 @@ set_namelist () {
# Add $VARNAME in namelist file ${EXE_DIR}/$1 in namelist group $NAMGRP
# on mac osx, replace sed --posix by gsed (available with mac port)
sed --posix "/${NAMGRP} /a\ ${VAR_NAME} " ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp || gsed --posix "/${NAMGRP} /a\ ${VAR_NAME} " ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
sed --posix -e "/${NAMGRP}[ !]/a\ ${VAR_NAME} " -e "/${NAMGRP}$/a\ ${VAR_NAME} " ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp || \
gsed --posix -e "/${NAMGRP}[ !]/a\ ${VAR_NAME} " -e "/${NAMGRP}$/a\ ${VAR_NAME} " ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
# if file not empty replace ${EXE_DIR}/$1
if [ -s ${EXE_DIR}/$1.tmp ] ; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment