I was trying to run a script to set my Oracle environment in RHEL. I ran it as ./foo.env, but it wouldn't run because of a permissions issue. I then ran it as . ./foo.env, and it ran successfully. What's the difference between the two, exactly?


Running ./foo.env means you're trying to execute the file as a shell script. Running a file as a shell script means that the file must have executable permission for your account. Running . ./foo.env is the equivalent of source ./foo.env, which means you only need to have read permission to the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.