As in, say I execute
pwd to return the current directory and want to dump this in a script file so that I can come back, but I then need to prefix it with 'cd '?
I don't quite understand what you are asking here.
Maybe you could try something like this?
In case you're trying to accomplish this: