Shellscript to Sudo other account

Thanks Madhan, the sed line will get the data for the element data-1.
What is the command to get the HOMEDIR values from /etc/passwd. Where i need to set the HOMEDIR in a variable and then pass it to the "sed" command.
Some thing like :-

homedirvalue= "cat /etc/passwd/$HOMEDIR";

Please correct me in this.

Thanks

Thanks Madhan, It works. Thank u very much..