Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.bashrc
06-19-2018, 07:10 PM
Post: #1
.bashrc
we can use ~/.bashrc with "export" command to create some permanent variables, in order to prevent repeatedly typing some complicated paths or hostnames. for example:
Code:
export PATH=~/forest/code/code:$PATH

export LD_LIBRARY_PATH=${HOME}/devroot/lib
export PATH=${HOME}/devroot/bin:$PATH
export PKG_CONFIG_PATH=${HOME}/devroot/lib/pkgconfig

export PATH="~/Packages/:${PATH}"

export tb20="ada.zettadom.com:30022"
export tb15="wretar.dthink.net:22108"
export otter="192.168.1.107"
export limbo1="10.6.10.20"
export camel="192.168.1.104"
export tb25="floyd.shufangkeji.com:25022"
Find all posts by this user
Quote this message in a reply
06-20-2018, 11:11 AM
Post: #2
RE: .bashrc
(06-19-2018 07:10 PM)cchen Wrote:  we can use ~/.bashrc with "export" command to create some permanent variables, in order to prevent repeatedly typing some complicated paths or hostnames. for example:
Code:
export PATH=~/forest/code/code:$PATH

export LD_LIBRARY_PATH=${HOME}/devroot/lib
export PATH=${HOME}/devroot/bin:$PATH
export PKG_CONFIG_PATH=${HOME}/devroot/lib/pkgconfig

export PATH="~/Packages/:${PATH}"

export tb20="ada.zettadom.com:30022"
export tb15="wretar.dthink.net:22108"
export otter="192.168.1.107"
export limbo1="10.6.10.20"
export camel="192.168.1.104"
export tb25="floyd.shufangkeji.com:25022"

When you write some tutorials like this, please find someone to review as you may be missing something.

In this case, export is a command in bash while .bashrc is a script that is being run before a bash shell is up. Please make sure to seperate these two concepts in the headpost.
Find all posts by this user
Quote this message in a reply
06-20-2018, 11:32 AM
Post: #3
"export" command
we can use "export" command to create some variables, in order to prevent repeatedly typing some complicated paths and hostnames. for example:
Code:
export PATH=~/forest/code/code:$PATH

export LD_LIBRARY_PATH=${HOME}/devroot/lib
export PATH=${HOME}/devroot/bin:$PATH
export PKG_CONFIG_PATH=${HOME}/devroot/lib/pkgconfig

export PATH="~/Packages/:${PATH}"

export tb20="ada.zettadom.com:30022"
export tb15="wretar.dthink.net:22108"
export otter="192.168.1.107"
export limbo1="10.6.10.20"
export camel="192.168.1.104"
export tb25="floyd.shufangkeji.com:25022"

To make this change permanent, it is suggested to write these commands into ~/.bashrc file, so that these variables can be permanently accessible
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: