When you run it in a script is it as the same user with the same shell?
yes, same user and same shell (/bin/bash) I forgot to mention the #!/bin/bash in the header.
Is the script picking up your environment?
Yes, I tought, i did not explicit any new environement var.