[建议]贴出自己的.profile
-
- 帖子: 16
- 注册时间: 2006-01-06 11:35
[建议]贴出自己的.profile
我在这里建议大家贴出自己的.profile来分享交流一下,简单说说这个.profile是如何促进工作的?
-
- 帖子: 262
- 注册时间: 2007-03-29 12:59
# /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
# 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
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
-
- 帖子: 40
- 注册时间: 2007-02-21 16:03
俺的:
代码: 全选
# ~/.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
- 帖子: 30
- 注册时间: 2007-07-01 8:59
- 来自: HZ
- 联系:
-
- 帖子: 73
- 注册时间: 2007-05-17 9:38
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
奇怪,这是我们老大配置的。。没有设置java环境变量,怎么
代码: 全选
ubuntu@sonoro-dev-00:~$ javac -version
javac 1.6.0_01
-
- 帖子: 11
- 注册时间: 2007-06-29 9:37
-
- 帖子: 28
- 注册时间: 2007-08-07 22:43
我的
# /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
umask 022
我的好怪啊,和你们的怎么差那么多啊
# 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
umask 022
我的好怪啊,和你们的怎么差那么多啊
水至清则无鱼.
人至贱则无敌.
人至贱则无敌.
- qianjigui
- 帖子: 221
- 注册时间: 2007-06-26 23:50
- 来自: WHU
- 联系:
代码: 全选
# ~/.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
####################################################################
-
- 帖子: 19
- 注册时间: 2008-11-29 0:33
Re:
我是菜鸟,什么都不懂,勇敢的问一下: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
这是些什么语言呢?是shell么(其实Shell是什么我也不知道)
还有,CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib 这行命令是什么意思?“:”和“$”是什么意思?