diff --git a/template/script.sh.erb b/template/script.sh.erb
index 54c185de20c40284afdb4f7c58609f1435863df8..f54c1020af057b09357a4771a5534f7441f2e86a 100755
--- a/template/script.sh.erb
+++ b/template/script.sh.erb
@@ -7,7 +7,7 @@ module reset
 # Start Jupyter Notebook Server
 #
 module load Anaconda3
-<%= context.custom_environment %>
+<%= context.custom_environment.gsub(/\r\n?/, "\n") %>
 unset XDG_RUNTIME_DIR
 # Launch the Jupyter Notebook Server
 jupyter notebook --config="${CONFIG_FILE}" <%= context.extra_jupyter_args %>