setting PATH / variable env lewat terminal linux


saat ingin memfungsikan beberapa perintah di terminal linux seperti java untuk java dan cake bake misalnya untuk cakePHP framework kita perlu meng ekspor variable yang dibutuhkan, misalnya saya butuh path untuk cakePHP maka saya ekspor semua yang saya butuhkan (fedora export variable) dibwah folder console, hal ini hanya temporary, begitu ganti terminal/logout/restart maka akan hilang,

export PATH=$PATH:/home/yoesoff/Documents/projects/cakephp/cake/console

lainnta misal java :

export JAVA_HOME=/usr/java/j2sdk1.4.0_01

 

Nah, yang diatas kan di Terminal langsung dan bersifat temporary, bila ingin permanen harus bikin *.sh, SEBENERNYA BISA AJA LANGSUNG DI file :       /etc/bashrc tapi disana ada tulisan warning tentang ini :

# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# It’s NOT a good idea to change this file unless you know what you
# are doing. It’s much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

# are we an interactive shell?

ikuti daran diatas, kita tambahkan baris export PATH=$PATH:/home/yoesoff/Documents/projects/cakephp/cake/console

(path yang tadi diatas dimasukan misal ke file berektesi .sh bernama bebas/terserah anda misal folder /etc/profile.d/cakephp.sh )

Ok selesai.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s