add exec_command function.

add exec_command function.