Can some review my code would be appreicated?

From the ksh man page:

<<[-]word     The shell input is read up to a line that matches word, or to an end-of-file.  No parameter 
              substitution, command substitution, or file name generation is performed on word.  The resulting 
              document, called a here-document, becomes the standard input.  If any character of word is quoted, 
              no interpretation is placed upon the characters of the document.  Otherwise, parameter and command 
              substitution occurs, \new-line is ignored, and \ must be used to quote the characters \, $, `, and 
              the first character of word.  If - is appended to <<, all leading tabs are stripped from word and 
              from the document.

Also, take a look at: changepass automate password changes on multiple systems