Bash contains builtin variables that you can view by typing the env command. You can get some valuable information from that command. Such as Present /current working directory. You can use these variables to get what you are after.
Here is a snippet of the env output.
In your script you can get these variables by echoing them. E.G.
[jralph@jralph-linux ~]$ env
Hope this get's you started. You can post what you have so far and we can assist you.
[jralph@jralph-linux notes]$ echo $HOME
[jralph@jralph-linux notes]$ echo $PWD
Also have a look at the PS manpage. As well as the HEAD and WC man page for other requirements.
UNIX man pages : ps ()
UNIX man pages : head ()
UNIX man pages : wc ()
Some examples of the variable echoing.
[jralph@jralph-linux notes]$ cat scripter.sh
echo "Hello the users home directory is $HOME"
echo "The users curent directory is $PWD"
If you run it you get.
[jralph@jralph-linux notes]$ ./scripter.sh
Hello the users home directory is /home/PFTCTRADING/jralph
The users curent directory is /home/PFTCTRADING/jralph/notes