Salome HOME
Fix some bashisms and potential errors in Launcher service generated shell scripts
[modules/kernel.git] / src / Launcher / Launcher_Job_Command.cxx
index 5c3b52aca56b243452125ccb976a2be488b11067..fd193e5211feb7ff892b8e3cdfb6e1517d96d1e6 100644 (file)
@@ -59,14 +59,14 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l
   launch_script_stream.open(launch_script.c_str(), std::ofstream::out);
    
   // Script
-  launch_script_stream << "#! /bin/bash -f" << std::endl;
+  launch_script_stream << "#!/bin/sh -f" << std::endl;
   launch_script_stream << "cd " << work_directory << std::endl;
   launch_script_stream << "export PYTHONPATH=" << work_directory << ":$PYTHONPATH" << std::endl;
   launch_script_stream << "export PATH=" << work_directory << ":$PATH" << std::endl;
   if (_env_file != "")
   {
     std::string::size_type last = _env_file.find_last_of("/");
-    launch_script_stream << "source ./" << _env_file.substr(last+1) << std::endl;
+    launch_script_stream << ". ./" << _env_file.substr(last+1) << std::endl;
   }
   launch_script_stream << "./" << _job_file_name_complete << " > " << work_directory <<"/logs/command_" << launch_date << ".log 2>&1" << std::endl;