Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to get a user data script working on EC2, Amazon Linux distro. The script does run, but for most commands, such as ec2-metadata or gem it complains about command not found. The tools are installed, and i can run them when I log in.

I guess, it has to do with the PATH not being set or something like that. How can I make the script behave as if I was running it in a shell?

Currently, I have started to work around with lines like the following, but it get's out of hand. /usr/local/rvm/bin/rvm default do bundle install

share|improve this question

1 Answer 1

Although not using Amazon Linux, I have managed to get my user script working without having to declare full paths by exporting PATH at the top of the file.

export=$PATH:/insert/your/path/here:/other/path/here
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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