[建议]贴出自己的.profile
发表于 : 2007-02-09 1:42
我在这里建议大家贴出自己的.profile来分享交流一下,简单说说这个.profile是如何促进工作的?
bash启动脚本shuhill 写了:小菜菜弱弱的问一下. profile 是干啥的.
新手,刚学Linux几天.
代码: 全选
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
JAVA_HOME=/usr/lib/jvm/java-6-sun
CATALINA_HOME=/home/jimmy/develop/tomcat
JBOSS_HOME=/home/jimmy/develop/jboss
ANT_HOME=/home/home/jimmy/develop/ant
PATH=${PATH}:$JAVA_HOME/bin:$CATALINA_HOME/bin:$JBOSS_HOME/bin:$ANT_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib
export JAVA_HOME CATALINA_HOME JBOSS_HOME ANT_HOME PATH CLASSPATH
kenwu 写了:一点意思都没有, 环境变量不应该跟机器耦合!
如果我把服务器移到另一台机器上,难道我还要再同样配置一遍吗?
我认为, 这些变量应该配置在tomcat启动脚本里!
代码: 全选
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
代码: 全选
ubuntu@sonoro-dev-00:~$ javac -version
javac 1.6.0_01
找个Linux做女朋友,哈哈!那个版本的Linux最漂亮,就找那个,呵呵!BigSnake.NET 写了:bash启动脚本shuhill 写了:小菜菜弱弱的问一下. profile 是干啥的.
新手,刚学Linux几天.
代码: 全选
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
#########################Install all useful tools###################
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
export PATH
####################################################################
#######################JAVA path####################################
JAVA_HOME=/usr/local/java/jdk1.5.0_09
export JAVA_HOME
PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export PATH
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export CLASSPATH
####################################################################
我是菜鸟,什么都不懂,勇敢的问一下:ziyun 写了:# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='[\u@\h \W]\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
JAVA_HOME=/usr/local/jdk
JRE_HOME=/usr/local/jre
CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export JAVA_HOME JRE_HOME CLASSPATH
umask 022