[cig-commits] [commit] devel: better fix in the run_this_example.sh script (now handles lines that are comments but have white spaces before the first # sign) (792a19b)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Dec 10 17:04:07 PST 2014
Repository : https://github.com/geodynamics/specfem3d
On branch : devel
Link : https://github.com/geodynamics/specfem3d/compare/7641628b86180869af4865131e6c26d47b723abe...792a19b464179eb88e075ebdbb8148bf1eb7f17d
>---------------------------------------------------------------
commit 792a19b464179eb88e075ebdbb8148bf1eb7f17d
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date: Thu Dec 11 02:00:45 2014 +0100
better fix in the run_this_example.sh script (now handles lines that are comments but have white spaces before the first # sign)
>---------------------------------------------------------------
792a19b464179eb88e075ebdbb8148bf1eb7f17d
.../run_this_example.sh | 2 +-
run_this_example.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh b/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh
index 4d3eda2..d5ad295 100755
--- a/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh
+++ b/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh
@@ -38,7 +38,7 @@ cp DATA/CMTSOLUTION OUTPUT_FILES/
cp DATA/STATIONS OUTPUT_FILES/
# get the number of processors, ignoring comments in the Par_file
-NPROC=`grep NPROC DATA/Par_file | grep -v ^# | cut -d = -f 2`
+NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
# decomposes mesh using the pre-saved mesh files in MESH-default
echo
diff --git a/run_this_example.sh b/run_this_example.sh
index ca98138..e6be198 100755
--- a/run_this_example.sh
+++ b/run_this_example.sh
@@ -24,7 +24,7 @@ cp DATA/CMTSOLUTION OUTPUT_FILES/
cp DATA/STATIONS OUTPUT_FILES/
# get the number of processors, ignoring comments in the Par_file
-NPROC=`grep NPROC DATA/Par_file | grep -v ^# | cut -d = -f 2`
+NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
# decomposes mesh using the pre-saved mesh files in MESH-default
echo
More information about the CIG-COMMITS
mailing list