+#${DELIM} Environment switch: 0 for SALOME building, 1 for SALOME launching ${DELIM}
+export ENV_FOR_LAUNCH=1
+
+EOF
+### !!! The next is for RedHat 9 only !!!
+if [ -f /etc/redhat-release ] ; then
+ grep -e "Red Hat Linux release 9" /etc/redhat-release > /dev/null
+ if [ $? -eq 0 ] ; then
+ cat >> ${install_work}/$SHRC <<EOF
+#${DELIM} Force RH9 to use old implementation of threads ${DELIM}
+export LD_ASSUME_KERNEL=2.4.18
+
+EOF
+ fi
+fi
+### !!! writing salome.csh file !!! -> set inital variables
+pre_vars="PATH LD_LIBRARY_PATH LD_RUN_PATH PYTHONPATH TCLLIBPATH"
+for i in $pre_vars ; do
+cat >> ${install_work}/$CSHRC <<EOF
+#${DELIM} setting initial ${i} ${DELIM}
+if (! (\$?${i}) ) then
+ setenv $i
+endif
+
+EOF
+done
+
+### !!! writing salome.(c)sh files !!! -> dump products environment files, changing 'export' by 'setenv(a|p)' where necessary
+### Note, that for performance reasons temporary environment files used during installation procedure itself
+### are created without using setenv(a|p) aliases.
+
+# 1. first dump all environment files into the $SHRC file
+product_sequence="$2"
+for i in $product_sequence ; do
+ cat ${install_work}/env_${i}.sh >> ${install_work}/$SHRC 2>/dev/null
+done
+
+# 2. writing global functions to _salome.sh file
+cat >> ${install_work}/_$SHRC <<EOF