Psalm 23: "1 The LORD is my shepherd; I shall not want. 2 He makes me lie down in green pastures. He leads me beside still waters. 3 He restores my soul. He leads me in paths of righteousness for his name's sake.
"4 Even though I walk through the valley of the shadow of death, I will fear no evil, for you are with me; your rod and your staff, they comfort me.
"5 You prepare a table before me in the presence of my enemies; you anoint my head with oil; my cup overflows. 6 Surely goodness and mercy shall follow me all the days of my life, and I shall dwell in the house of the LORD forever."
John 10:11: "'I am the good shepherd. The good shepherd lays down his life for the sheep.'"
Revelation 7:17: "'For the Lamb in the midst of the throne will be their shepherd, and he will guide them to springs of living water, and God will wipe away every tear from their eyes.'"
+++
The text is public domain:
1 The Lord's my shepherd, I'll not want;He makes me down to lieIn pastures green; He leadeth meThe quiet waters by.2 My soul He doth restore againAnd me to walk doth makeWithin the paths of righteousness,E'en for His own name's sake.3 Yea, though I walk in death's dark vale,Yet will I fear no ill;For Thou art with me, and Thy rodAnd staff me comfort still.4 My table Thou hast furnishedIn presence of my foes;My head Thou dost with oil anoint,And my cup overflows.5 Goodness and mercy all my lifeShall surely follow me;And in God's house forevermoreMy dwelling place shall be.
+++
The hymn is a paraphrase of Psalm 23. Each verse of the hymn corresponds to a verse of the Psalm, except for the first verse, which encompasses the first two verses of the Psalm (so Psalm 23:3 appears in the hymn's second verse; Psalm 23:4 in the third verse; and so on).
John 10:11 and Revelation 7:17 also appear in the first verse, although they merely overlap with elements from Psalm 23. Both passages contain shepherd imagery, and "he will guide them to springs of living water" from Revelation 7:17 is similar to "He leads me beside still waters" in Psalm 23:2 and appears in the hymn as "He leadeth me / The quiet waters by."