diff --git a/cfg/CentOs6/cmake.profile b/cfg/CentOs6/cmake.profile
index e28887b839a570b1a1158331f0cf3a29941586e7..c7b8d1f51efd4885a8c5cecce748bb4eba077214 100644
--- a/cfg/CentOs6/cmake.profile
+++ b/cfg/CentOs6/cmake.profile
@@ -1 +1 @@
-export PATH=/opt/cmake/bin:$PATH
+add2env PATH "/opt/cmake/bin"
diff --git a/cfg/CentOs6/compilers.bashrc b/cfg/CentOs6/compilers.bashrc
index 14a7a3f7070f5c8ecaa358a103a55d4c0e0ebf71..4667b3849ba48ed45e8018ddb78311dbe284d091 100644
--- a/cfg/CentOs6/compilers.bashrc
+++ b/cfg/CentOs6/compilers.bashrc
@@ -1,13 +1,2 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
-
-# recompiled gcc
-export PATH=/opt/gcc/bin:$PATH
-export LD_LIBRARY_PATH=/opt/gcc/lib64:$LD_LIBRARY_PATH
-
-# icc
-#if [ -z "$MKLROOT" ]; then
-#   . /opt/intel/bin/compilervars.sh intel64
-#fi
-
+add2env PATH "/opt/gcc/bin" front
+add2env LD_LIBRARY_PATH "/opt/gcc/lib64" front
\ No newline at end of file
diff --git a/cfg/CentOs6/compilers.profile b/cfg/CentOs6/compilers.profile
index 189080c89da8454eeadd1d0a924853ec544ab7ee..583bfd338ecb69ff22f13a2822fb4a52d4d1abe1 100644
--- a/cfg/CentOs6/compilers.profile
+++ b/cfg/CentOs6/compilers.profile
@@ -1,13 +1,2 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
-#
-#
-# recompiled gcc
-export PATH=/opt/gcc/bin:$PATH
-export LD_LIBRARY_PATH=/opt/gcc/lib64:$LD_LIBRARY_PATH
-# icc
-#if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
-#      . /opt/intel/bin/compilervars.sh intel64
-   #fi
-#fi
+add2env PATH "/opt/gcc/bin" front
+add2env LD_LIBRARY_PATH "/opt/gcc/lib64" front
diff --git a/cfg/CentOs6/matlab.profile b/cfg/CentOs6/matlab.profile
index 48e86c19c81d1722ee7665f4722ec8972433e583..f391a0e7a093fc9ef70814eed4869a0b9fc14ec3 100644
--- a/cfg/CentOs6/matlab.profile
+++ b/cfg/CentOs6/matlab.profile
@@ -1,2 +1 @@
-PATH=$PATH:/opt/MATLAB/R2012a/bin
-
+add2env PATH "/opt/MATLAB/R2012a/bin"
diff --git a/cfg/CentOs6/mumps.profile b/cfg/CentOs6/mumps.profile
index 75ef411d75bf7957ef369715f2e9bbe54897d9f8..57e0adabd33cd60503f6133f2c8fa4acd4e77105 100644
--- a/cfg/CentOs6/mumps.profile
+++ b/cfg/CentOs6/mumps.profile
@@ -1,9 +1,3 @@
-# $id$
-#
-# configuration to allow CMake to automatically find mumps 
-#
-export LIB=$LIB:/opt/mumps/lib
-export INCLUDE=$INCLUDE:/opt/mumps/include
-
-# not necessary while cmake link with absolute path to libs
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mumps/lib
+add2env LD_LIBRARY_PATH "/opt/mumps/lib"
+add2env LIB "/opt/mumps/lib"
+add2env INCLUDE "/opt/mumps/include"
diff --git a/cfg/CentOs6/parasolid.profile b/cfg/CentOs6/parasolid.profile
index c1211517d3ea608c88f597e131fd69d2e36236ed..e24e2e80de8a8cf8b1f2a4f4ef7f632bb44dcb81 100644
--- a/cfg/CentOs6/parasolid.profile
+++ b/cfg/CentOs6/parasolid.profile
@@ -1,30 +1,3 @@
-# Parasolid
-
-# adds pskernel.so to the PATH
-
-if [ -d /opt/parasolid/shared_object ] ; then
-    if [ -z "${PATH}" ] ; then
-       export PATH="/opt/parasolid/shared_object"
-    else
-       export PATH="/opt/parasolid/shared_object:${PATH}"
-    fi
-    if [ -z "${LD_LIBRARY_PATH}" ] ; then
-       export LD_LIBRARY_PATH="/opt/parasolid/shared_object"
-    else
-       export LD_LIBRARY_PATH="/opt/parasolid/shared_object:${LD_LIBRARY_PATH}"
-    fi
-
-fi
-
-# adds parasolid INCLUDE dir
-
-if [ -d /opt/parasolid ] ; then
-    if [ -z "${INCLUDE}" ] ; then
-       export INCLUDE="/opt/parasolid"
-    else
-       export INCLUDE="/opt/parasolid:${INCLUDE}"
-    fi
-fi
-
+add2env PATH "/opt/parasolid/shared_object"
+add2env INCLUDE "/opt/parasolid"
 export P_SCHEMA=/opt/parasolid/schema
-
diff --git a/cfg/CentOs6/python.profile b/cfg/CentOs6/python.profile
index b0880e923e98a674c9578e1d06e11022d8e1a310..e3a25880c5aefe89bd0604b01b4754383123fcdc 100644
--- a/cfg/CentOs6/python.profile
+++ b/cfg/CentOs6/python.profile
@@ -1,2 +1,2 @@
-export PATH=/opt/python-2.7.10/bin:$PATH
-export LD_LIBRARY_PATH=/opt/python-2.7.10/lib:$LD_LIBRARY_PATH
+add2env PATH "/opt/python-2.7.10/bin" front
+add2env LD_LIBRARY_PATH "/opt/python-2.7.10/lib" front
diff --git a/cfg/CentOs6/qt.profile b/cfg/CentOs6/qt.profile
index a395354bf11b48a25c3510c741bce5868af7ae32..cf036d1e4c45b320092c760db4f36de5d40fde35 100644
--- a/cfg/CentOs6/qt.profile
+++ b/cfg/CentOs6/qt.profile
@@ -1,2 +1,2 @@
-export PATH=/opt/qt/bin:$PATH
-export LD_LIBRARY_PATH=/opt/qt/lib:$LD_LIBRARY_PATH
+add2env PATH "/opt/qt/bin" front
+add2env LD_LIBRARY_PATH "/opt/qt/bin" front
diff --git a/cfg/CentOs6/samcef.profile b/cfg/CentOs6/samcef.profile
deleted file mode 100644
index 2ea188a25f7b377d0b1d08166a80b39af80201b4..0000000000000000000000000000000000000000
--- a/cfg/CentOs6/samcef.profile
+++ /dev/null
@@ -1,8 +0,0 @@
-# Samcef v15.01-3
-
-export SAM_ZONE=200000000
-#PATH=$PATH:/opt/SamcefField/V8.5-01
-PATH=$PATH:/opt/SamcefField/V8.5-01/Samcef-V151i8/lin/bin
-export SAM_USE_FLEXLM=1
-export SAMTECH_LICENSE_FILE=@pegase.ltas.ulg.ac.be
-
diff --git a/cfg/CentOs6/subversion.profile b/cfg/CentOs6/subversion.profile
index 0167db98f268d1b50f4742c3721d09fc55d0a57c..807b808e5596dfa45ca414993275c6034e6da209 100644
--- a/cfg/CentOs6/subversion.profile
+++ b/cfg/CentOs6/subversion.profile
@@ -1 +1 @@
-export PATH=/opt/subversion-1.8.14/bin:$PATH
+add2env PATH "/opt/subversion-1.8.14/bin" front
diff --git a/cfg/CentOs6/vtk.profile b/cfg/CentOs6/vtk.profile
index 6e88e22bc25706b32a3affec23ca6513d8beb3d1..6b85d7fdd6176f1afc6003e46f89d19bab889c91 100644
--- a/cfg/CentOs6/vtk.profile
+++ b/cfg/CentOs6/vtk.profile
@@ -1,5 +1,2 @@
-
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/vtk/lib/
-export LD_LIBRARY_PATH
-PYTHONPATH=$PYTHON_PATH:/opt/vtk/lib/python2.7/site-packages
-export PYTHONPATH
+add2env LD_LIBRARY_PATH "/opt/vtk/lib/"
+add2env PYTHON_PATH "/opt/vtk/lib/python2.7/site-packages"
diff --git a/cfg/blueberry/intelCommunity.bashrc b/cfg/blueberry/intelCommunity.bashrc
index 55a852147a6be89f15b753ccffdb2eb417ad9574..09fe18c1e4284810ed589a52a0f277eeec31f3e3 100644
--- a/cfg/blueberry/intelCommunity.bashrc
+++ b/cfg/blueberry/intelCommunity.bashrc
@@ -1,6 +1,17 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -z "$MKLROOT" ]; then
     . /opt/intel/mkl/bin/mklvars.sh intel64
diff --git a/cfg/blueberry/intelCommunity.profile b/cfg/blueberry/intelCommunity.profile
index d2bff7e91365254a90cf848f4bedada265a3abf7..3fa6997e30102509582894798e281ff71bc3adbf 100644
--- a/cfg/blueberry/intelCommunity.profile
+++ b/cfg/blueberry/intelCommunity.profile
@@ -1,11 +1,19 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
-      . /opt/intel/mkl/bin/mklvars.sh intel64
-   #fi
-   #if [ -z "$TBBROOT" ]; then
-      . /opt/intel/tbb/bin/tbbvars.sh intel64
-   #fi
+    . /opt/intel/mkl/bin/mklvars.sh intel64
+    . /opt/intel/tbb/bin/tbbvars.sh intel64
 fi
diff --git a/cfg/blueberry/mumps.profile b/cfg/blueberry/mumps.profile
index 2d94cb97dbe90c9afed9ea931657faefc4179c53..57e0adabd33cd60503f6133f2c8fa4acd4e77105 100644
--- a/cfg/blueberry/mumps.profile
+++ b/cfg/blueberry/mumps.profile
@@ -1,6 +1,3 @@
-# MUMPS + MKL-TBB
-
 add2env LD_LIBRARY_PATH "/opt/mumps/lib"
 add2env LIB "/opt/mumps/lib"
 add2env INCLUDE "/opt/mumps/include"
-
diff --git a/cfg/blueberry/parasolid.profile b/cfg/blueberry/parasolid.profile
index 5f9e03b4ced76e54599b8c6f8f83baf2acc79648..e24e2e80de8a8cf8b1f2a4f4ef7f632bb44dcb81 100644
--- a/cfg/blueberry/parasolid.profile
+++ b/cfg/blueberry/parasolid.profile
@@ -1,6 +1,3 @@
-# Parasolid
-
 add2env PATH "/opt/parasolid/shared_object"
 add2env INCLUDE "/opt/parasolid"
 export P_SCHEMA=/opt/parasolid/schema
-
diff --git a/cfg/clifton/intelCommunity.bashrc b/cfg/clifton/intelCommunity.bashrc
index 6b5efc457535a8ae8edf1b7d1bb5bbeb1dee5f2d..7b93b13d833bc210e40c7d9937d7ac1503934b8b 100644
--- a/cfg/clifton/intelCommunity.bashrc
+++ b/cfg/clifton/intelCommunity.bashrc
@@ -1,9 +1,19 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -z "$MKLROOT" ]; then
-#   . /opt/intel/bin/compilervars.sh intel64
     . /opt/intelCommunity2017/mkl/bin/mklvars.sh intel64
 fi
 if [ -z "$TBBROOT" ]; then
diff --git a/cfg/clifton/intelCommunity.profile b/cfg/clifton/intelCommunity.profile
index 8d2cadb48b19c2753ee60e1a24f4b9a1b21b8769..c74dbb2ddedd11150fd0c304a3405c4ba2faa089 100644
--- a/cfg/clifton/intelCommunity.profile
+++ b/cfg/clifton/intelCommunity.profile
@@ -1,13 +1,19 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
-      #. /opt/intel/bin/compilervars.sh intel64
-      . /opt/intelCommunity2017/mkl/bin/mklvars.sh intel64
-   #fi
-   #if [ -z "$TBBROOT" ]; then
-      . /opt/intelCommunity2017/tbb/bin/tbbvars.sh intel64
-   #fi
-
+    . /opt/intelCommunity2017/mkl/bin/mklvars.sh intel64
+    . /opt/intelCommunity2017/tbb/bin/tbbvars.sh intel64
 fi
diff --git a/cfg/clifton/matlab.profile b/cfg/clifton/matlab.profile
index df9a2286b8b82b1ab3228879e18434ac157db22f..58f04e5f09c874bcc5056f9ecf77706f944a2b56 100644
--- a/cfg/clifton/matlab.profile
+++ b/cfg/clifton/matlab.profile
@@ -1,2 +1 @@
-PATH=$PATH:/opt/MATLAB/R2015a/bin
-
+add2env PATH "/opt/MATLAB/R2015a/bin"
diff --git a/cfg/clifton/mumps.profile b/cfg/clifton/mumps.profile
index e4ff5f5ce75ea4c9144a28cc5b2a9891f98e55d5..98a366c7d20c9d7712982713a6e76346fa7e3b18 100644
--- a/cfg/clifton/mumps.profile
+++ b/cfg/clifton/mumps.profile
@@ -1,10 +1,3 @@
-# $Id$
-#
-# configuration to allow CMake to automatically find mumps 
-#
-LIB=$LIB:/opt/mumps-4.10.0-Tbb/lib
-export LIB
-INCLUDE=$INCLUDE:/opt/mumps-4.10.0-Tbb/include
-export INCLUDE
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mumps-4.10.0-Tbb/lib
-export LD_LIBRARY_PATH
+add2env LD_LIBRARY_PATH "/opt/mumps-4.10.0-Tbb/lib"
+add2env LIB "/opt/mumps-4.10.0-Tbb/lib"
+add2env INCLUDE "/opt/mumps-4.10.0-Tbb/include"
diff --git a/cfg/clifton/parasolid.profile b/cfg/clifton/parasolid.profile
index 8dfef6fc49ad3c53ab0399b7a3b06fb8953fc36e..158db8db591e75e568f865553354565a00721b48 100644
--- a/cfg/clifton/parasolid.profile
+++ b/cfg/clifton/parasolid.profile
@@ -1,24 +1,5 @@
 # Parasolid
 
-# adds pskernel.so to the PATH
-
-if [ -d /opt/parasolid-28.1/shared_object ] ; then
-    if [ -z "${PATH}" ] ; then
-       export PATH="/opt/parasolid-28.1/shared_object"
-    else
-       export PATH="/opt/parasolid-28.1/shared_object:${PATH}"
-    fi
-fi
-
-# adds parasolid INCLUDE dir
-
-if [ -d /opt/parasolid-28.1 ] ; then
-    if [ -z "${INCLUDE}" ] ; then
-       export INCLUDE="/opt/parasolid-28.1"
-    else
-       export INCLUDE="/opt/parasolid-28.1:${INCLUDE}"
-    fi
-fi
-
+add2env PATH "/opt/parasolid-28.1/shared_object"
+add2env INCLUDE "/opt/parasolid-28.1"
 export P_SCHEMA=/opt/parasolid-28.1/schema
-
diff --git a/cfg/clifton/samcef.profile b/cfg/clifton/samcef.profile
index 121ccc7fe91ded18de1b4111fa27fe7d6da346af..b504e28fd91cc1030e8f7fb0eec14e7817d59f76 100644
--- a/cfg/clifton/samcef.profile
+++ b/cfg/clifton/samcef.profile
@@ -1,7 +1,2 @@
-# Samcef v17.1 i8
-
 export SAM_ZONE=200000000
-PATH=$PATH:/opt/Samv17i8/
-#export SAM_USE_FLEXLM=1
-#export SAMTECH_LICENSE_FILE=@pegase.ltas.ulg.ac.be
-
+add2env PATH "/opt/Samv17i8"
diff --git a/cfg/default/aliases.bashrc b/cfg/default/aliases.bashrc
index 98c206b760c2065ccfff23077f9a0bb72c60f370..9cc8ef1e273a1a34157682f3260ee3215551b71c 100644
--- a/cfg/default/aliases.bashrc
+++ b/cfg/default/aliases.bashrc
@@ -1,3 +1 @@
-
 alias verif='cd ~/dev/oo_meta/apps/verif'
-
diff --git a/cfg/default/editor.bashrc b/cfg/default/editor.bashrc
index ea04dba353d1224728899b98a6c7a247f07c005c..e0560ade6886a1efcdad3e47690ee4ebc200768a 100644
--- a/cfg/default/editor.bashrc
+++ b/cfg/default/editor.bashrc
@@ -1,3 +1,2 @@
-
 export EDITOR=vim
 alias vi='vim'
diff --git a/cfg/default/functions.bashrc b/cfg/default/functions.bashrc
index 2b177c489a68aa9f0ed33b745f87438bfd59e100..30bb21f9ce8cb1b7622b4d6cebae5ef4db24a71a 100644
--- a/cfg/default/functions.bashrc
+++ b/cfg/default/functions.bashrc
@@ -1,5 +1,3 @@
-# Fonctions generales
-
 function backup()
 {
     ARC=backup-profile-bin.tar.gz
diff --git a/cfg/default/omp.profile b/cfg/default/omp.profile
index 4b6bf3f6c5debc8af0bb7940f074d9c42a05ae84..ea8dc08228dd3c4cb8181f6f32d9c9912f2c9a1b 100644
--- a/cfg/default/omp.profile
+++ b/cfg/default/omp.profile
@@ -1,3 +1 @@
-
 export OMP_NUM_THREADS=1
-
diff --git a/cfg/fabulous/lammps.profile b/cfg/fabulous/lammps.profile
index 07f77ad52395a46fae9041b8253777cd71d9e825..348d0d9ed9c9acec4f311fa4a33a2e392bcf1910 100644
--- a/cfg/fabulous/lammps.profile
+++ b/cfg/fabulous/lammps.profile
@@ -1,5 +1 @@
-
-if [ -d ~/dev/lammps/src ] ; then
-    PATH=$PATH:~/dev/lammps/src
-fi
-
+add2env PATH "~/dev/lammps/src"
diff --git a/cfg/fabulous/ls_colors.bashrc b/cfg/fabulous/ls_colors.bashrc
index f80ed49be1bde29f8a57d180697c22aff1884e88..8971679c7e7904e7f42e7f204b9afea405770590 100644
--- a/cfg/fabulous/ls_colors.bashrc
+++ b/cfg/fabulous/ls_colors.bashrc
@@ -1,4 +1,2 @@
-
 LS_COLORS='di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36'
 export LS_COLORS
-
diff --git a/cfg/fabulous/modules.profile b/cfg/fabulous/modules.profile
index 9185c6a5938e780e3c835958ca1ea349ce8f24e9..08634cbc83c133f286080ece9cf5b7af00009510 100644
--- a/cfg/fabulous/modules.profile
+++ b/cfg/fabulous/modules.profile
@@ -3,14 +3,12 @@ module load slurm
 module load git subversion
 module load gcc cmake swig
 module load python qt vtk parasolid mumps
-#module load gmm trilinos
 
 module load samcef gmsh 
 module load isosurf tetgen triangle
 module load matlab scilab
 
 # intel community 
-#. /cm/shared/apps/intel-community/2017.2/bin/compilervars.sh intel64
 . /cm/shared/apps/intel-community/2017.2/mkl/bin/mklvars.sh intel64
 . /cm/shared/apps/intel-community/2017.2/tbb/bin/tbbvars.sh intel64
 
diff --git a/cfg/fabulous/progs_bin.profile b/cfg/fabulous/progs_bin.profile
deleted file mode 100644
index 3d34ff0aaf2ba3efa7b4e08d16cd0b8c8c3bb18e..0000000000000000000000000000000000000000
--- a/cfg/fabulous/progs_bin.profile
+++ /dev/null
@@ -1,2 +0,0 @@
-
-add2env PATH "$HOME/dev/progs/bin" front
diff --git a/cfg/garfield/compilers.bashrc b/cfg/garfield/compilers.bashrc
index 6f6574b96781c3c86b5d7e8c6d085c764d13e96a..3f73074a32091bf5187617b4a4971c1317a5e1c3 100644
--- a/cfg/garfield/compilers.bashrc
+++ b/cfg/garfield/compilers.bashrc
@@ -1,9 +1,19 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -z "$MKLROOT" ]; then
-      #. /opt/intel/bin/compilervars.sh intel64 # mets intel mpi par defaut!
       . /opt/intel/mkl/bin/mklvars.sh intel64
       . /opt/intel/tbb/bin/tbbvars.sh intel64
 fi
diff --git a/cfg/garfield/compilers.profile b/cfg/garfield/compilers.profile
index a046a25d55cb24d6f3ddb900972a41254c4a5bf0..3fa6997e30102509582894798e281ff71bc3adbf 100644
--- a/cfg/garfield/compilers.profile
+++ b/cfg/garfield/compilers.profile
@@ -1,10 +1,19 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
-      #. /opt/intel/bin/compilervars.sh intel64 # mets intel mpi par defaut!
-      . /opt/intel/mkl/bin/mklvars.sh intel64
-      . /opt/intel/tbb/bin/tbbvars.sh intel64
-   #fi
+    . /opt/intel/mkl/bin/mklvars.sh intel64
+    . /opt/intel/tbb/bin/tbbvars.sh intel64
 fi
diff --git a/cfg/garfield/metafor.bashrc b/cfg/garfield/metafor.bashrc
index 05ffa73d4208bfbbf04f125351b718f0e9d54775..5ada172088dcc0d450222db079960c84f1ce5d5a 100644
--- a/cfg/garfield/metafor.bashrc
+++ b/cfg/garfield/metafor.bashrc
@@ -1,6 +1,4 @@
-
 function mtfconfig
 {
     cmake -C ../oo_meta/CMake/ubuntu.cmake ../oo_meta
 }
-
diff --git a/cfg/garfield/metafor.profile b/cfg/garfield/metafor.profile
deleted file mode 100644
index 33f66ebc2e673195786763c6f8b0d8bac57825d3..0000000000000000000000000000000000000000
--- a/cfg/garfield/metafor.profile
+++ /dev/null
@@ -1,6 +0,0 @@
-# permet d'installer un metafor compilé
-# (plus très utile depuis scripts Luc?)
-
-#add2env LD_LIBRARY_PATH "$HOME/MetaforBIN"
-#add2env PATH "$HOME/MetaforBIN"
-
diff --git a/cfg/garfield/misc.bashrc b/cfg/garfield/misc.bashrc
index 5f2964a687c80fa2ff385c04f6749a000215318b..352e8fc3c401cb48c6a180d526686a9a83ac4567 100644
--- a/cfg/garfield/misc.bashrc
+++ b/cfg/garfield/misc.bashrc
@@ -1,10 +1,2 @@
-# misc aliases
-
 alias a2ps='a2ps --pro=color --line-numbers=5'
 alias plotdigitizer='java -Xmx256m -jar /opt/PlotDigitizer/PlotDigitizer.jar'
-
-function mnt_Shared()
-{
-    sudo mount -t vboxsf Shared /mnt
-}
-
diff --git a/cfg/garfield/mumps.profile b/cfg/garfield/mumps.profile
index 2d94cb97dbe90c9afed9ea931657faefc4179c53..57e0adabd33cd60503f6133f2c8fa4acd4e77105 100644
--- a/cfg/garfield/mumps.profile
+++ b/cfg/garfield/mumps.profile
@@ -1,6 +1,3 @@
-# MUMPS + MKL-TBB
-
 add2env LD_LIBRARY_PATH "/opt/mumps/lib"
 add2env LIB "/opt/mumps/lib"
 add2env INCLUDE "/opt/mumps/include"
-
diff --git a/cfg/garfield/parasolid.profile b/cfg/garfield/parasolid.profile
index 5f9e03b4ced76e54599b8c6f8f83baf2acc79648..e24e2e80de8a8cf8b1f2a4f4ef7f632bb44dcb81 100644
--- a/cfg/garfield/parasolid.profile
+++ b/cfg/garfield/parasolid.profile
@@ -1,6 +1,3 @@
-# Parasolid
-
 add2env PATH "/opt/parasolid/shared_object"
 add2env INCLUDE "/opt/parasolid"
 export P_SCHEMA=/opt/parasolid/schema
-
diff --git a/cfg/garfield/paraview.bashrc b/cfg/garfield/paraview.bashrc
index ac9fb65c4fef9cce7425ab252ec73c7f0f002fb0..22720195a40104256eddb5cdcc221bc4724f082a 100644
--- a/cfg/garfield/paraview.bashrc
+++ b/cfg/garfield/paraview.bashrc
@@ -1,2 +1,2 @@
-
 alias paraview='/opt/paraview/bin/paraview'
+alias pvserver='/opt/paraview/bin/pvserver'
diff --git a/cfg/garfield/progs_bin.profile b/cfg/garfield/progs_bin.profile
deleted file mode 100644
index 3d34ff0aaf2ba3efa7b4e08d16cd0b8c8c3bb18e..0000000000000000000000000000000000000000
--- a/cfg/garfield/progs_bin.profile
+++ /dev/null
@@ -1,2 +0,0 @@
-
-add2env PATH "$HOME/dev/progs/bin" front
diff --git a/cfg/garfield/python.profile b/cfg/garfield/python.profile
index 668d2796dfeb39391ddafc1e4a06d9ee7733fe70..67b3efbe880fbd161163c29043aea0d199a458df 100644
--- a/cfg/garfield/python.profile
+++ b/cfg/garfield/python.profile
@@ -1,2 +1,2 @@
-# binaires ajouté par pip par exemple (pip lui-meme ou yapf)
+# binaires ajoute par pip par exemple (pip lui-meme ou yapf)
 add2env PATH "$HOME/.local/bin" front
diff --git a/cfg/garfield/samcef.profile b/cfg/garfield/samcef.profile
index e52e31a0b973bcfcc136c742ccba41a154f226dc..542f794364f83456411c6d441ab01eeed6620602 100644
--- a/cfg/garfield/samcef.profile
+++ b/cfg/garfield/samcef.profile
@@ -4,7 +4,7 @@ add2env PATH "/opt/samcef"
 # pas besoin de definir LMS_LICENSE
 # (deja defini dans "/opt/samcef/site" lors de l'install)
 
-
+# -----------------------------------------------------------
 # version "russe"
 #add2env PATH "/opt/sfield/V8.5-01/Samcef-V151i8/lin/bin"
 #export SAMTECH_LICENSE_FILE=/opt/sfield/V8.5-01/SAMTECH.lic
\ No newline at end of file
diff --git a/cfg/garfield/trilinos.bashrc b/cfg/garfield/trilinos.bashrc
index d49863cf01d017ba65ec8262280e739004cbcd77..a26619a1108ebe82913b21b1cba30b58db8b5cc2 100644
--- a/cfg/garfield/trilinos.bashrc
+++ b/cfg/garfield/trilinos.bashrc
@@ -1,4 +1,3 @@
-# Trilinos custom compilé localement
-
+# Trilinos custom compile localement
 # (permet le FIND_PACKAGE(Trilinos) dans CMake)
-add2env CMAKE_PREFIX_PATH "/opt/trilinos" front
+#add2env CMAKE_PREFIX_PATH "/opt/trilinos" front
diff --git a/cfg/garfield/vtk.profile b/cfg/garfield/vtk.profile
index 2f2befcd7f447c951dce9c674edae6f2b71cce26..cb69d4c9381f54e82af191d63980fe11e6ae735b 100644
--- a/cfg/garfield/vtk.profile
+++ b/cfg/garfield/vtk.profile
@@ -1,2 +1,2 @@
-# vtk custom compilé localement
+# vtk custom compile localement
 #add2env LD_LIBRARY_PATH "/usr/local/lib/vtk-5.10"
diff --git a/cfg/gaston/intelCommunity.bashrc b/cfg/gaston/intelCommunity.bashrc
index 55a852147a6be89f15b753ccffdb2eb417ad9574..7fb2effa4b737db5f5bc12c26503b3c56bb657f0 100644
--- a/cfg/gaston/intelCommunity.bashrc
+++ b/cfg/gaston/intelCommunity.bashrc
@@ -1,6 +1,17 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -z "$MKLROOT" ]; then
     . /opt/intel/mkl/bin/mklvars.sh intel64
@@ -8,4 +19,3 @@ fi
 if [ -z "$TBBROOT" ]; then
     . /opt/intel/tbb/bin/tbbvars.sh intel64
 fi
-
diff --git a/cfg/gaston/intelCommunity.profile b/cfg/gaston/intelCommunity.profile
index d2bff7e91365254a90cf848f4bedada265a3abf7..25011564808cb6ddd5f141521806c0f4e4a824ec 100644
--- a/cfg/gaston/intelCommunity.profile
+++ b/cfg/gaston/intelCommunity.profile
@@ -1,11 +1,19 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
       . /opt/intel/mkl/bin/mklvars.sh intel64
-   #fi
-   #if [ -z "$TBBROOT" ]; then
       . /opt/intel/tbb/bin/tbbvars.sh intel64
-   #fi
 fi
diff --git a/cfg/gaston/mumps.profile b/cfg/gaston/mumps.profile
index 2d94cb97dbe90c9afed9ea931657faefc4179c53..57e0adabd33cd60503f6133f2c8fa4acd4e77105 100644
--- a/cfg/gaston/mumps.profile
+++ b/cfg/gaston/mumps.profile
@@ -1,6 +1,3 @@
-# MUMPS + MKL-TBB
-
 add2env LD_LIBRARY_PATH "/opt/mumps/lib"
 add2env LIB "/opt/mumps/lib"
 add2env INCLUDE "/opt/mumps/include"
-
diff --git a/cfg/gaston/parasolid.profile b/cfg/gaston/parasolid.profile
index 5f9e03b4ced76e54599b8c6f8f83baf2acc79648..e24e2e80de8a8cf8b1f2a4f4ef7f632bb44dcb81 100644
--- a/cfg/gaston/parasolid.profile
+++ b/cfg/gaston/parasolid.profile
@@ -1,6 +1,3 @@
-# Parasolid
-
 add2env PATH "/opt/parasolid/shared_object"
 add2env INCLUDE "/opt/parasolid"
 export P_SCHEMA=/opt/parasolid/schema
-
diff --git a/cfg/hmem00/git.profile b/cfg/hmem00/git.profile
index 4871e7ad017b9bc2e47aaaf291194704db3ba0ce..e98447133fda195dc895dc8957f958270db47c0a 100644
--- a/cfg/hmem00/git.profile
+++ b/cfg/hmem00/git.profile
@@ -1,6 +1 @@
-
-
 unset SSH_ASKPASS
-
-
-
diff --git a/cfg/hmem00/modules.profile b/cfg/hmem00/modules.profile
index 6c80be25cc5ebe5e7ca7ff9cceafbdfa0298d509..d263785c26ec624e224fed59eebf61ff19b8d0fa 100644
--- a/cfg/hmem00/modules.profile
+++ b/cfg/hmem00/modules.profile
@@ -1,5 +1,2 @@
-
 module load cmake python 
 module load intel/compiler
-
-
diff --git a/cfg/loop.sh b/cfg/loop.sh
index ca61df12df4aad220abad5f1bff85919916724a1..e3b00cae4a4951ae6e1a9f04452940204ccf2658 100755
--- a/cfg/loop.sh
+++ b/cfg/loop.sh
@@ -1,4 +1,3 @@
-# $Id: loop.sh 1755 2013-05-30 12:18:36Z boman $
 # 
 # usage: 
 #   add the following calls to the end of the .bashrc/.profile cfg files
@@ -7,32 +6,36 @@
 #   .bashrc: (interactive stuffs)
 #      . $HOME/bin/cfg/loop.sh ; fct_loop bashrc $* ; unset fct_loop
 #
-# arg1 is the extension of the files to be loaded
-# arg2 is the name of the master node if needed (clusters)
-#
 # if this script is sometimes run with dash (not bash!)
-# (by gnome on ubuntu for the .profile)
+# (by gnome on ubuntu/debian for the .profile)
 #  => avoid bashisms (e.g. ~ becomes $HOME)
-#
-# RoBo 2013
-
 
 function add2env()
 {
+    #verb=1  #uncomment to debug script
+
     if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
         echo "add2env VARNAME folder [front]"
         return
     fi
-    if [ -d $2 ] ; then          # if the second arg is an existing folder
-        if [ -z ${!1} ] ; then   # if the first arg is an empty variable
+
+    ndir=${2%/}                  # remove trailing space
+    if [ -d $ndir ] ; then       # if the second arg is an existing folder
+        if [ -z ${!1} ] ; then   # if the first arg is an empty env variable
             #echo $1 is empty
-            eval export $1="$2"
+            eval export $1="$ndir"
         else
             #echo $1 is not empty
-            if [ "$3" == "front" ] ; then
-                eval export $1="$2:\$$1"  # add folder to the front
+            if ! eval echo \$$1 | grep -E -q "(^|:)$ndir($|:)" ; then   # if ndir is not already present in the variable
+                if [ "$3" == "front" ] ; then
+                    eval export $1="$ndir:\$$1"  # add folder to the front
+                else
+                    eval export $1="\$$1:$ndir"  # add folder to the end
+                fi
             else
-                eval export $1="\$$1:$2"  # add folder to the end
+                if [ -n "$verb" ] ; then
+                    echo "! $1 already contains $ndir"
+                fi
             fi
         fi
     else
@@ -42,14 +45,21 @@ function add2env()
 
 }
 
+# arg1 is the extension of the files to be loaded
+# arg2 is the name of the master node if needed (clusters)
+
 function fct_loop()
 {
     umask 007
 
-    #echo "Execute loop.sh"
-    #echo "script=$0"
-    #echo "nargs=$#"
-    #echo "arguments=$*"
+    #verb=1  #uncomment to debug script
+
+    if [ -n "$verb" ] ; then
+        echo "Executing \"loop.sh $*\" with shell=$0"
+        #echo "script=$0"
+        #echo "nargs=$#"
+        #echo "arguments=$*"
+    fi
     #for var in "$@"; do
     #	echo "var=$var"
     #done
@@ -66,14 +76,16 @@ function fct_loop()
     # default cfg
     
     for i in $thisdir/default/*.$1 ; do
-    #echo "testing script $i ..."
-    if [ -r $i ]; then
-        # do not read file if a file with the same name exists in the "myhost" folder
-        if [ ! -f $thisdir/$myhost/`basename $i` ] ; then
-            #echo "  =>loading script $i ..."
-            . $i
+        #echo "testing script $i ..."
+        if [ -r $i ]; then
+            # do not read file if a file with the same name exists in the "myhost" folder
+            if [ ! -f $thisdir/$myhost/`basename $i` ] ; then
+                if [ -n "$verb" ] ; then
+                    echo "  =>loading script $i ..."
+                fi
+                . $i
+            fi
         fi
-    fi
     done
     
     # machine-dependent cfg
@@ -81,9 +93,27 @@ function fct_loop()
     for i in $thisdir/$myhost/*.$1 ; do
         #echo "testing script $i ..."
         if [ -r $i ]; then
-            #echo "  =>loading script $i ..."
+            if [ -n "$verb" ] ; then
+                echo "  =>loading script $i ..."
+            fi
             . $i
         fi
     done
     unset i
+
+
+    # remove duplicate entries in env vars ----
+    # see https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command
+
+    # - initial version
+    #LD_LIBRARY_PATH=$(printf %s "$LD_LIBRARY_PATH" | awk -v RS=: '{ if (!arr[$0]++) {printf("%s%s",!ln++?"":":",$0)}}')
+    # - loop version
+    for var in PATH LD_LIBRARY_PATH INTEL_LICENSE_FILE CPATH INFOPATH NLSPATH LIBRARY_PATH MANPATH CLASSPATH MIC_LIBRARY_PATH MIC_LD_LIBRARY_PATH 
+    do
+        if [ -n "$(eval echo \$$var)" ] ; then # if var is set
+            cmd="$var=\$(printf %s \"\$$var\" | awk -v RS=: '{ if (!arr[\$0]++) {printf(\"%s%s\",!ln++?\"\":\":\",\$0)}}')"
+            eval $(echo $cmd)
+        fi
+    done
+
 }
diff --git a/cfg/master2/git.profile b/cfg/master2/git.profile
index bee69f72e68aa4a13f5beaea4b51c7d0b3eaff58..07acaaf5836e1a831c0326cdf9ebffafebf041c5 100644
--- a/cfg/master2/git.profile
+++ b/cfg/master2/git.profile
@@ -1,3 +1 @@
-
 module load git
-
diff --git a/cfg/master2/gmm.profile b/cfg/master2/gmm.profile
index 266b12bebcb720700c8113fc9d6d5ced5bec4e84..a3259caee1a5a1064604dba631a4534f1d25e022 100644
--- a/cfg/master2/gmm.profile
+++ b/cfg/master2/gmm.profile
@@ -1,4 +1,2 @@
 # gmm compile localement
-
 add2env INCLUDE "/home/ulg/nlcm/rboman/local/gmm/include" front
-
diff --git a/cfg/master2/gmsh.profile b/cfg/master2/gmsh.profile
index 7505f59040605a25bcf6413babffbb2597b95294..b54f563b38bc5577b5e6815a7d63cf424ea349fb 100644
--- a/cfg/master2/gmsh.profile
+++ b/cfg/master2/gmsh.profile
@@ -1,4 +1,2 @@
 # gmsh compile par RB
-
 add2env PATH "/home/ulg/nlcm/rboman/local/gmsh/bin" front
-
diff --git a/cfg/master2/lammps.profile b/cfg/master2/lammps.profile
index 07f77ad52395a46fae9041b8253777cd71d9e825..348d0d9ed9c9acec4f311fa4a33a2e392bcf1910 100644
--- a/cfg/master2/lammps.profile
+++ b/cfg/master2/lammps.profile
@@ -1,5 +1 @@
-
-if [ -d ~/dev/lammps/src ] ; then
-    PATH=$PATH:~/dev/lammps/src
-fi
-
+add2env PATH "~/dev/lammps/src"
diff --git a/cfg/master2/pcre.profile b/cfg/master2/pcre.profile
index b98426cce23b5ab5bb03f84e10e340350006260d..e81830e2936daf80f6470eb9c33e0bc4a43c949a 100644
--- a/cfg/master2/pcre.profile
+++ b/cfg/master2/pcre.profile
@@ -1,6 +1,4 @@
 # pcre (swig) compile localement par RB
-
 add2env LIB "/home/ulg/nlcm/rboman/local/pcre/lib" front
 add2env INCLUDE "/home/ulg/nlcm/rboman/local/pcre/include" front
 add2env LD_LIBRARY_PATH "/home/ulg/nlcm/rboman/local/pcre/lib" front
-
diff --git a/cfg/master2/python.profile b/cfg/master2/python.profile
index 5d06da14c7454e4339c50bbbebed2a2eb3897422..dcbf3344fd36e8afffbb7f917cbfa2704e0a4325 100644
--- a/cfg/master2/python.profile
+++ b/cfg/master2/python.profile
@@ -1,6 +1,4 @@
-
 module load python/2.7.10
 
 # trucs qui manquent dans le modulefile de David
 add2env CMAKE_PREFIX_PATH "/cm/shared/apps/python/2.7.10" front
-
diff --git a/cfg/master2/swig.profile b/cfg/master2/swig.profile
index b99ddb6370613a78cc4d86f994e88518254bfee7..3a1acaeede6beec68c542333994f4dd3a862e4fa 100644
--- a/cfg/master2/swig.profile
+++ b/cfg/master2/swig.profile
@@ -1,4 +1 @@
-# swig recompile localement par RB
-
 add2env PATH "/home/ulg/nlcm/rboman/local/swig-3.0.11/bin" front
-
diff --git a/cfg/spirou/cmake.profile b/cfg/spirou/cmake.profile
index 2b5121cf8744d1cc21d76c5615bdde054cced96b..732d4fefcca250f25745b96339da4e2bc869614b 100644
--- a/cfg/spirou/cmake.profile
+++ b/cfg/spirou/cmake.profile
@@ -1,3 +1 @@
-
-
 add2env PATH "/Applications/CMake.app/Contents/bin"
diff --git a/cfg/spirou/gmsh.profile b/cfg/spirou/gmsh.profile
index 6950dac412198f465fd744e46aaf9c4d9dcd2349..3b40fed4ac916a89be382c976cdce297822b1634 100644
--- a/cfg/spirou/gmsh.profile
+++ b/cfg/spirou/gmsh.profile
@@ -1,2 +1 @@
-
 add2env PATH "/Applications/Gmsh.app/Contents/MacOS"
diff --git a/cfg/spirou/intel.profile b/cfg/spirou/intel.profile
index 33b60d96e575ff27692ffb0e581cf774fb3cc2f0..202314b4a5c96a5f906f474ddda0d7c311bf845e 100644
--- a/cfg/spirou/intel.profile
+++ b/cfg/spirou/intel.profile
@@ -1,4 +1,3 @@
-
 . /opt/intel/compilers_and_libraries/mac/mkl/bin/mklvars.sh intel64
 . /opt/intel/compilers_and_libraries/mac/tbb/bin/tbbvars.sh intel64
 
diff --git a/cfg/spirou/matlab.bashrc b/cfg/spirou/matlab.bashrc
index f218f35a545976d54ebf785413c6152815a252c5..9a3e3519ad780451ab6a99254c91f5d85dbbcb69 100644
--- a/cfg/spirou/matlab.bashrc
+++ b/cfg/spirou/matlab.bashrc
@@ -1 +1 @@
-alias matlab='/Applications/MATLAB_R2016b.app/bin/matlab'
\ No newline at end of file
+alias matlab='/Applications/MATLAB_R2016b.app/bin/matlab'
diff --git a/cfg/spirou/mumps.profile b/cfg/spirou/mumps.profile
index 9163d49bef55942eb278ec0cc62ee8f15120b3ff..92cbf63189565601018b6cf438073035fe204ca0 100644
--- a/cfg/spirou/mumps.profile
+++ b/cfg/spirou/mumps.profile
@@ -1,4 +1,2 @@
-
 add2env LIB "/opt/mumps/lib"
 add2env INCLUDE "/opt/mumps/include"
-
diff --git a/cfg/spirou/parasolid.profile b/cfg/spirou/parasolid.profile
index 566343177752d2985ed1676b4810428630eeb5ec..e81e5c2ec96605be07683107faa95a4eda9444fb 100644
--- a/cfg/spirou/parasolid.profile
+++ b/cfg/spirou/parasolid.profile
@@ -1,6 +1,3 @@
-# Parasolid
-
 add2env PATH "/usr/local/parasolid/shared_object"
 add2env INCLUDE "/usr/local/parasolid"
 export P_SCHEMA=/usr/local/parasolid/schema
-
diff --git a/cfg/spirou/prompt.bashrc b/cfg/spirou/prompt.bashrc
index cf9ee2156e59b4eecaa5d68206bf657a1bd957bf..8583cd585c741b2fb3d14151eb79372834ae016d 100644
--- a/cfg/spirou/prompt.bashrc
+++ b/cfg/spirou/prompt.bashrc
@@ -1,3 +1 @@
-
 export PS1="\[$(tput bold)\]\u@\h:\w$ \[$(tput sgr0)\]"
-
diff --git a/cfg/spirou/qt.profile b/cfg/spirou/qt.profile
index 558cc5bdd543c669bd9ec762a352885ddf55977e..59d39de6d4b5b608ed3dd27c56b6057000ea02bf 100644
--- a/cfg/spirou/qt.profile
+++ b/cfg/spirou/qt.profile
@@ -1,4 +1,2 @@
-
 add2env PATH "/usr/local/qt-5.8.0/bin"
 add2env DYLD_LIBRARY_PATH "/usr/local/qt-5.8.0/lib"
-
diff --git a/cfg/spirou/vtk.profile b/cfg/spirou/vtk.profile
index d8acaf9c303f52e5fef16ecf468d847c14451967..2718ac59081b7c084806eb929818680beb1de663 100644
--- a/cfg/spirou/vtk.profile
+++ b/cfg/spirou/vtk.profile
@@ -1,3 +1,2 @@
-
 add2env PYTHONPATH "/usr/local/vtk-7.1.0/lib/python2.7/site-packages"
 add2env DYLD_LIBRARY_PATH "/usr/local/vtk-7.1.0/lib"
diff --git a/cfg/spring/compilers.bashrc b/cfg/spring/compilers.bashrc
index 78f2ef9c4d8949a6b0f5402b99fe7e0a2872f5e4..09e595ab75f0238944165eb52b843820fcac8469 100644
--- a/cfg/spring/compilers.bashrc
+++ b/cfg/spring/compilers.bashrc
@@ -1,10 +1,18 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -z "$MKLROOT" ]; then
       . /opt/intel/bin/compilervars.sh intel64
-      #. /opt/intel/mkl/bin/mklvars.sh intel64
-      #. /opt/intel/tbb/bin/tbbvars.sh intel64
 fi
-
diff --git a/cfg/spring/compilers.profile b/cfg/spring/compilers.profile
index a08a1fb707f61bd6327706e51867d93813acfba4..f8c5c50d1acafb34f20ea46b4d4b142a2c720a66 100644
--- a/cfg/spring/compilers.profile
+++ b/cfg/spring/compilers.profile
@@ -1,22 +1,18 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
       . /opt/intel/bin/compilervars.sh intel64 # mets intel mpi par defaut!
-      #. /opt/intel/mkl/bin/mklvars.sh intel64
-      #. /opt/intel/tbb/bin/tbbvars.sh intel64
-   #fi
 fi
-
-# remove duplicate entries in LD_LIBRARY_PATH
-# see https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command
-
-# -version initiale
-#LD_LIBRARY_PATH=$(printf %s "$LD_LIBRARY_PATH" | awk -v RS=: '{ if (!arr[$0]++) {printf("%s%s",!ln++?"":":",$0)}}')
-# -version "boucle"
-for var in PATH LD_LIBRARY_PATH INTEL_LICENSE_FILE CPATH INFOPATH NLSPATH LIBRARY_PATH MANPATH CLASSPATH
-do
-   cmd="$var=\$(printf %s \"\$$var\" | awk -v RS=: '{ if (!arr[\$0]++) {printf(\"%s%s\",!ln++?\"\":\":\",\$0)}}')"
-   eval $(echo $cmd)
-done
\ No newline at end of file
diff --git a/cfg/spring/mumps.profile b/cfg/spring/mumps.profile
index 2d94cb97dbe90c9afed9ea931657faefc4179c53..57e0adabd33cd60503f6133f2c8fa4acd4e77105 100644
--- a/cfg/spring/mumps.profile
+++ b/cfg/spring/mumps.profile
@@ -1,6 +1,3 @@
-# MUMPS + MKL-TBB
-
 add2env LD_LIBRARY_PATH "/opt/mumps/lib"
 add2env LIB "/opt/mumps/lib"
 add2env INCLUDE "/opt/mumps/include"
-
diff --git a/cfg/spring/parasolid.profile b/cfg/spring/parasolid.profile
index 5f9e03b4ced76e54599b8c6f8f83baf2acc79648..e24e2e80de8a8cf8b1f2a4f4ef7f632bb44dcb81 100644
--- a/cfg/spring/parasolid.profile
+++ b/cfg/spring/parasolid.profile
@@ -1,6 +1,3 @@
-# Parasolid
-
 add2env PATH "/opt/parasolid/shared_object"
 add2env INCLUDE "/opt/parasolid"
 export P_SCHEMA=/opt/parasolid/schema
-
diff --git a/cfg/thorgal/intelCommunity.bashrc b/cfg/thorgal/intelCommunity.bashrc
index 55a852147a6be89f15b753ccffdb2eb417ad9574..09fe18c1e4284810ed589a52a0f277eeec31f3e3 100644
--- a/cfg/thorgal/intelCommunity.bashrc
+++ b/cfg/thorgal/intelCommunity.bashrc
@@ -1,6 +1,17 @@
-# this should be done in the .profile but if the shell is dash
-# it does not work.
-# => we call intel cf file  in both places (bashrc & profile)
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -z "$MKLROOT" ]; then
     . /opt/intel/mkl/bin/mklvars.sh intel64
diff --git a/cfg/thorgal/intelCommunity.profile b/cfg/thorgal/intelCommunity.profile
index d2bff7e91365254a90cf848f4bedada265a3abf7..25011564808cb6ddd5f141521806c0f4e4a824ec 100644
--- a/cfg/thorgal/intelCommunity.profile
+++ b/cfg/thorgal/intelCommunity.profile
@@ -1,11 +1,19 @@
-# the .profile is sometimes read by "dash" and we cannot provide 
-# a sourced script with some parameters (it is a "bashism")
+# Intel compiler and/or TBB/MKL 
+#
+# EXPLANATIONS [RB]:
+# In practise, the call to "compilervars.sh" or ("mklvars.sh", etc) should be done in .profile 
+#  (it sets PATH, LD_LIBRARY_PATH, etc.)
+#
+# BUT, if the login shell is dash, it does not work (we cannot add an extra argument to a sourced script with dash). 
+# => we call the scripts in both places (.bashrc & .profile)
+# => the env is cleaned in "loop.sh", removing duplicates if the .profile was actually read by bash
+#
+# SPECIAL CASE: "at" job
+# => the environment is OK and kept, but "LD_LIBRARY_PATH" is set to nothing by "at"
+# => the .profile is then rerun manually in our scripts (with bash)
+# => duplicates are finally removed by loop.sh
 
 if [ -n "$BASH_VERSION" ]; then
-   #if [ -z "$MKLROOT" ]; then  # pas suffisant! (MKLROOT transmis au "at" mais pas LD_LIBRARY_PATH)
       . /opt/intel/mkl/bin/mklvars.sh intel64
-   #fi
-   #if [ -z "$TBBROOT" ]; then
       . /opt/intel/tbb/bin/tbbvars.sh intel64
-   #fi
 fi
diff --git a/cfg/thorgal/mumps.profile b/cfg/thorgal/mumps.profile
index 2d94cb97dbe90c9afed9ea931657faefc4179c53..57e0adabd33cd60503f6133f2c8fa4acd4e77105 100644
--- a/cfg/thorgal/mumps.profile
+++ b/cfg/thorgal/mumps.profile
@@ -1,6 +1,3 @@
-# MUMPS + MKL-TBB
-
 add2env LD_LIBRARY_PATH "/opt/mumps/lib"
 add2env LIB "/opt/mumps/lib"
 add2env INCLUDE "/opt/mumps/include"
-
diff --git a/cfg/thorgal/parasolid.profile b/cfg/thorgal/parasolid.profile
index 5f9e03b4ced76e54599b8c6f8f83baf2acc79648..e24e2e80de8a8cf8b1f2a4f4ef7f632bb44dcb81 100644
--- a/cfg/thorgal/parasolid.profile
+++ b/cfg/thorgal/parasolid.profile
@@ -1,6 +1,3 @@
-# Parasolid
-
 add2env PATH "/opt/parasolid/shared_object"
 add2env INCLUDE "/opt/parasolid"
 export P_SCHEMA=/opt/parasolid/schema
-
diff --git a/cfg/zen/eclipse.profile b/cfg/zen/eclipse.profile
index 989a22d062b1f35fd31bda768161ae84437d2853..3861d00e21ad97cb45d411a21136f8fe2dfc8ddc 100644
--- a/cfg/zen/eclipse.profile
+++ b/cfg/zen/eclipse.profile
@@ -1,5 +1 @@
-
-if [ -d ~/local/eclipse/cpp-mars/eclipse ] ; then
-    PATH=$PATH:~/local/eclipse/cpp-mars/eclipse
-fi
-
+add2env PATH "~/local/eclipse/cpp-mars/eclipse"
diff --git a/cfg/zen/lammps.profile b/cfg/zen/lammps.profile
index 07f77ad52395a46fae9041b8253777cd71d9e825..348d0d9ed9c9acec4f311fa4a33a2e392bcf1910 100644
--- a/cfg/zen/lammps.profile
+++ b/cfg/zen/lammps.profile
@@ -1,5 +1 @@
-
-if [ -d ~/dev/lammps/src ] ; then
-    PATH=$PATH:~/dev/lammps/src
-fi
-
+add2env PATH "~/dev/lammps/src"
diff --git a/externalProgramPath.py b/externalProgramPath.py
old mode 100644
new mode 100755
diff --git a/externalProgramPathGui.pyw b/externalProgramPathGui.pyw
old mode 100644
new mode 100755
diff --git a/postProLoop.py b/postProLoop.py
old mode 100644
new mode 100755
diff --git a/postProLoopGui.pyw b/postProLoopGui.pyw
old mode 100644
new mode 100755