Run cmd in map function.