Very new to Bash scripting...I am trying to setup a script that starts with a minimal CentOS 6 install and provisions it for Ruby development.#!/bin/bash# Add PostgreSQL Reporpm -i http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-redhat91-9.1-5.noarch.rpm# Add NginX Repoecho '[nginx]' > /etc/yum.repos.d/nginx.repoecho 'name=nginx repo' >> /etc/yum.repos.d/nginx.repoecho 'baseurl=http://nginx.org/packages/centos/6/$basearch/' >> /etc/yum.repos.d/nginx.repoecho 'gpgcheck=0' >> /etc/yum.repos.d/nginx.repoecho 'enabled=1' >> /etc/yum.repos.d/nginx.repo# Updateyum update -y# Install NginX, PostgreSQL, and Ruby Dependenciesyum install -y nginx postgresql91-server postgresql91-contrib gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison piconv-devel sqlite-devel git-core# PostgreSQL Post Installservice postgresql-9.1 initdbchkconfig postgresql-9.1 on# Install rbenv system wide installgit clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv# Install ruby-buildgit clone git://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build# Add rbenv to the pathecho '# rbenv setup - only add RBENV PATH variables if no single user install found' > /etc/profile.d/rbenv.shecho 'if [[ ! -d ${HOME}/.rbenv ]]; then' >> /etc/profile.d/rbenv.shecho '  export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.shecho '  export PATH=$RBENV_ROOT/bin:$PATH' >> /etc/profile.d/rbenv.shecho '  eval $(rbenv init -)' >> /etc/profile.d/rbenv.shecho 'fi'  >> /etc/profile.d/rbenv.shchmod +x /etc/profile.d/rbenv.sh# SHELL NEEDS TO BE REFRESHED HERE# Install latest Rubyrbenv install 1.9.3-p286# Set Global Rubyrbenv global 1.9.3-p286I am getting a rbenv: command not found error when it gets to the point where it uses rbenv because my shell needs refreshed/restarted for it to recognize the command.  How can I accomplish this?  Thanks.
Can I refresh my shell within a shell script?
bash;shell;centos;ruby
You could try sourcing the new environment files. Looking above, I guess,# SHELL NEEDS TO BE REFRESHED HEREsource /etc/profile.d/rbenv.shand/orsource ${HOME}/.rbenvplus any other files that have been created, that you need including in the current shell.