I have a question - why don't you use functions to print current working directory in bash?
Like:
#!/bin/bash
pwd # prints current working directory.
Or
#!/bin/bash
variable=`pwd`
echo $variable
Edited: Code above changed to be working without problems.