diff options
author | maheshgudi | 2017-10-17 12:43:03 +0530 |
---|---|---|
committer | maheshgudi | 2017-10-17 12:43:03 +0530 |
commit | 52c0408298a5559cb24f7e2f4251b207546c7d22 (patch) | |
tree | 268cdc64d3e5d10006edd4b289389e5bcfd38a51 /yaksh/bash_code_evaluator.py | |
parent | 774b184347c0460117356ccae85acd9b2dc45b3d (diff) | |
download | online_test-52c0408298a5559cb24f7e2f4251b207546c7d22.tar.gz online_test-52c0408298a5559cb24f7e2f4251b207546c7d22.tar.bz2 online_test-52c0408298a5559cb24f7e2f4251b207546c7d22.zip |
Add shebang to bash code evaluator
Diffstat (limited to 'yaksh/bash_code_evaluator.py')
-rw-r--r-- | yaksh/bash_code_evaluator.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |