Yes Sir it will give correct, but we will be testing for different test cases. So for some other test cases it will fail.
Or else we need to tell student to print only the answer nothing else.
For c, c++ and java, students have to write functions, in that case we do not need to worry about this.
So we can implement this for bash as well?