Doubt on Executing unix commands in script

How can I execute the unix command "cd - Change directory" command, so that my command prompt should be reflected for that change.

Example : Now you are in your home directory i.e /home/naresh and you have some sub directory called unixinfo in your home directory. i want to write a script,so that if i execute that script my commnad prompt should go to that subdirectory.

           I called cd /home/naresh/unixinfo command in script. But my command prompt is not changed. Can somebody please help me

           I can use the alias command for this. But i am doing some mini project for that

i will pass argument(dir name) to my script.my script will take the complete path from one
text i maintain and trying to change the directory to that path.
Can somebody suggest any alternative

why do you need that. You can set up aliases if you had to type long directory listings.

alias name='cd /some/long/dir/name/to/where/you/want'

in your .profile file and use it.

If you want to see which directory you cd'd to in your command prompt, add the following to your .profile (or in /etc/profile for everyone) :

PS1='$PWD" # "'

So if you are in your home directory, you'll see:

/home/naresh #

and you cd to unixinfo, your prompt will change to:

/home/naresh/unixinfo #

Note: this command form works in ksh (my shell of preference for over a decade) . If you are using another shell, the syntax may be different or not work.