Finding Out The Path Of The Home Folder

How do i find out the path of the home folder?
i need it to save something into the Library of Home with do shell script.

Use path to.

quoted form of POSIX path of ((path to library folder from user domain as Unicode text) & "whatever:else.txt")

Edit: With regards to the subject:

path to home folder


for a shell script maybe ~ (tilde} is sufficient to specify the home folder e.g.

set h to "Hello World"
do shell script "echo " & quoted form of h & " > ~/helloworld.txt"