def sh_escape(command):
 command = command.replace('\\', '\\\\')
 command = command.replace('$', '\\$')
 command = command.replace('"', '\\"')
 command = command.replace('`', '\\`')
 return command

def sh_escape ( command ) : command = command . replace ( '\\' , '\\\\' ) command = command . replace ( '$' , '\\$' ) command = command . replace ( '"' , '\\"' ) command = command . replace ( '`' , '\\`' ) return command
escape special characters from a command so that it can be passed as a double quoted string in a sh command .