When Moses heard God's decision in the case of the daughters of Zelophehad, which turned out in their favor so that they inherited their father's property, he thought, "This s a propitious time to urge a plea before the Lord, for if daughters are to inherit their father, then must my sons inherit my office."  He then began to pray to God that his successors, who, he hoped, were also to be his descendants, might be worthy leaders of their people. He said: "O my Lord, before whom come the spirits of all human beings, so that Thou knowest the spirit of each - whose spirit is proud, and whose spirit is meek; whose spirit is patient and whose spirit is restive; mayest Thou set over Thy community a man who is gifted with strength, with wisdom, with beauty, and with decorum, so that his conduct may not give offense to the people.  O Lord of the world! Thou knowest each man's views, and knowest that each man has a view of his own, hence, as I am about to depart from this world, I pray Thee, appoint a leader over them that will know how to deal with each man according to his views." 
Moses, being a truly pious man, thought when he saw his end approach, not of himself, but of the welfare of the community, for whom he implored a good and worthy leader.  Hence he furthermore said to God: "Let not my successor share my fate, for although I accepted the guidance of the people only after long hesitation, owing to Thy urgings and requests, still I shall not be permitted to lead them into the promised land. Mayest Thou then deal differently with my successor than Thou hast dealt with me, and permit him not only to lead the people in the desert, but to take them into the promised land.  He, however, shall be a man 'which may go out before them,' who, unlike the kings of the heathens, that sent their legions to war but themselves remain at home, shall himself lead Israel to war. But he shall also be a man 'which may come in before them;' may it be granted him to see the number of those returning from war no less than that of those going into war. O Lord of the world!" continued Moses, "Thou hast led Israel out of Egypt, not to punish them for their sins, but to forgive them, and Thou hast not led them out of Egypt that they may be without leaders, but that they may indeed have leaders. I insist, therefore, that Thou shouldst tell me whether or not Thou wilt grant them a leader."
This is one of the five occasions upon which Moses implored God to give him an answer to his question. When he saw that his appearance before Pharaoh only occasioned him to bring greater and greater cruelties upon Israel, he said to God, "Tell me if Thou wilt now deliver them, or not." He also demanded God's answer to the question, "Shall I now fall into their hands or not?" when at Rephindim, on account of the dearth of water, he was threatened by the people. The third occasion was when he prayed to God for Miriam's recovery, and said, "Tell me, wilt Thou heal her or not?" And lastly when, after long and fervent prayer, he asked God whether he should be permitted to enter into the Holy Land, he said, "Let me know if I am to enter the Holy Land or not." 
God fulfilled this wish of Moses, saying: "Thou hast now requested to be informed concerning thy immediate successor. I shall do more than this, and show thee all the judges and prophets that I will allow to arise for My children from not on to the resurrection of the dead." Then He showed Moses his successor Joshua, his successor's successor, Othniel, and all the other judges and prophets. Then God added these words: "Of all these that I have shown thee, each will have his individual spirit and his individual knowledge, but such a man as thou now wishest for thy successor, whose spirit is to embrace in itself the spirits of sixty myriads of Israel, so that he may speak to each one of them according to his understanding, such a man as this will not arise until the end of time. The Messiah will be inspired with a spirit that in itself will embrace the spirits of all mankind.
But now, concerning thy immediate successor, know then that he that watcheth the fig tree shall eat of its fruits, and he that waiteth upon his master will be promoted to honor, and thy sons shall not inherit the leadership because they concerned themselves little with the Torah. Joshua shall be thy successor, who served thee with devotion and showed thee great veneration, for at morn and eve he put up the benches in thy house of teaching and spread the carpets over them; he served thee as far as he was able, and Israel shall now know that he will therefore receive his reward.  Take then Joshua, a man such as thou didst wish as a successor, whom thou hast proven, and who knows how to deal with people of every tendency, 'and lay thy hand upon him.' Give him an opportunity, while thou art still alive, to speak in public and to pronounce the law, so that Israel may not after thy death contemptuously say of thy successor, 'As long as his teacher was alive, he dared not pronounce judgement, and now he wishes to do so!'  Although Joshua, who is not of thy kin, is to be thy successor, I shall nevertheless be mindful of the law that 'no inheritance shall remove from one tribe to another tribe,' for the dignity of leadership is to be reserved for thy family; Joshua 'shall stand even before Eleazar the priest, thy brother's son, who shall ask counsel for him according to the judgement of the Urim.'" 
After Moses in kindly words had induced Joshua to accept the leadership after his death, pointing out to him the great rewards that in the future world await the leaders of Israel, 'he took Joshua, and set him before Eleazar the priest, and before all the congregation,' that all might thereafter acknowledge him as his successor.  He then bade Joshua, who had been sitting on the floor like all the rest, rise and set himself upon a bench beside him. Joshua seated himself with the words, "Blessed be the Lord that hath through Moses bestowed the Torah upon Israel."  Moses honored Joshua furthermore by interrupting his discourse as soon as Joshua enter the house of teaching, and resuming it only when he had taken his seat.  Moses also bade a herald proclaim throughout the camp, "This man Joshua is worthy of being appointed by God as His shepherd." 
Moses distinguished Joshua not because God had ordered him to do so, but because he was sincerely glad to pass his dignity on to him, just as a father is glad to leave his possessions to his son. So, too, whereas God had bidden Moses to lay only one hand upon Joshua's head and in this way put his honor upon him, Moses fulfilled God's command by laying both his hands upon Joshua, and by this action bestowed upon him not only insight and understanding, but also a radiant countenance like that of Moses, from whose face issued rays like those of the sun. In giving all these qualities to Joshua, Moses lost nothing. Moses' wisdom was like a torch, whereas Joshua's may be compared to a candle only, and just as a torch loses none of its intensity if a candle is lighted therefrom, so little was Moses' wisdom diminished by the wisdom he gave to Joshua.  The rays, too, that emanated from Joshua's countenance were weaker than those from Moses', and not until the crossing of the Jordan did they attain their full intensity, so that upon beholding them, "the people feared him as they feared Moses." 
Joshua's appointment by God as Moses' successor had been Moses' most cherished wish, but he had not ventured to give expression to it, for he was mindful of the punishment God had sent over him when he had entreated Him to sent Aaron instead of himself to deliver Israel out of Egypt, and from that time he feared to make any proposals whatsoever to God. He was like the child who had once been burned by a coal, and the seeing a brightly sparkling jewel, took it to be a burning coal, and dared not touch it.