From 52c0408298a5559cb24f7e2f4251b207546c7d22 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Tue, 17 Oct 2017 12:43:03 +0530 Subject: Add shebang to bash code evaluator --- yaksh/bash_code_evaluator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'yaksh/bash_code_evaluator.py') diff --git a/yaksh/bash_code_evaluator.py b/yaksh/bash_code_evaluator.py index a4f1389..038d39c 100644 --- a/yaksh/bash_code_evaluator.py +++ b/yaksh/bash_code_evaluator.py @@ -77,7 +77,8 @@ class BashCodeEvaluator(BaseEvaluator): if self.test_case_args: self.tc_args_path = self.create_submit_code_file('main.args') self.write_to_submit_code_file(self.tc_args_path, self.test_case_args) - self.user_answer = self.user_answer.replace("\r", "") + shebang = "#!/bin/bash\n" + self.user_answer = shebang + self.user_answer.replace("\r", "") self.test_case = self.test_case.replace("\r", "") self.write_to_submit_code_file(self.submit_code_path, self.user_answer) self.write_to_submit_code_file(self.test_code_path, self.test_case) -- cgit