I don't think it's a good idea to rely on $PWD, the current directory is as easily available as `pwd` or getcwd(), depending on whether you use scripts/C/etc. Relying on environment variables seems error prone and subject to forgery?
Anyway, this is not a sudo bug. "PWD" is set by bash and dash, and it seems to work just fine: $ sudo sh -c 'echo $PWD' /home/martin -- sudo doesn't propagate $PWD https://bugs.launchpad.net/bugs/410022 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs