add some utility function for shell.