sh without any arguments will read commands from stdin. If you have not redirected stdin, it's waiting for your input at the terminal. Typing control-d will send EOF (end of file) and sh will exit, resuming the script.
Aside from possibly executing some startup files, sh < /dev/null should not do anything at all; when it attempts to read a command from stdin, it immediately sees EOF. Seems rather pointless.
As alister explains, the free-standing sh has started a clean interactive shell. To get out of it, type exit or the control code for end-of-file (usually ctrl/D ) .
See stty -a to find out the control code for end-of-file on ypur terminal.
"command sh" is used to create a trusted sesion ID (which is called from .exe)to execute a batch file.. so sh command is necessary and cannot remove that line..is there any other way to get the exact o/p?(the code given above is just a dummy code..actual code is different)