use getcwd rather than exec( "pwd" )