[建议]贴出自己的.profile

仅供存放个人的配置文件,不要在本版发问。
回复
taker2001
帖子: 16
注册时间: 2006-01-06 11:35

[建议]贴出自己的.profile

#1

帖子 taker2001 » 2007-02-09 1:42

我在这里建议大家贴出自己的.profile来分享交流一下,简单说说这个.profile是如何促进工作的?
ziyun
帖子: 262
注册时间: 2007-03-29 12:59

#2

帖子 ziyun » 2007-04-06 16:56

# /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
shuhill
帖子: 62
注册时间: 2007-04-20 13:05

#3

帖子 shuhill » 2007-05-12 16:23

小菜菜弱弱的问一下. profile 是干啥的.

新手,刚学Linux几天.
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#4

帖子 BigSnake.NET » 2007-05-12 16:25

shuhill 写了:小菜菜弱弱的问一下. profile 是干啥的.

新手,刚学Linux几天.
bash启动脚本
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
jimmy8848
帖子: 40
注册时间: 2007-02-21 16:03

#5

帖子 jimmy8848 » 2007-06-21 15:00

俺的:

代码: 全选

# ~/.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
联系:

#6

帖子 kenwu » 2007-07-04 12:34

一点意思都没有, 环境变量不应该跟机器耦合!
如果我把服务器移到另一台机器上,难道我还要再同样配置一遍吗?
我认为, 这些变量应该配置在tomcat启动脚本里!
technology is a war
duanyong
帖子: 73
注册时间: 2007-05-17 9:38

#7

帖子 duanyong » 2007-07-06 16:25

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
[/code]
alex_kame
帖子: 11
注册时间: 2007-06-29 9:37

#8

帖子 alex_kame » 2007-07-12 8:35

BigSnake.NET 写了:
shuhill 写了:小菜菜弱弱的问一下. profile 是干啥的.

新手,刚学Linux几天.
bash启动脚本
找个Linux做女朋友,哈哈!那个版本的Linux最漂亮,就找那个,呵呵!
amagle
帖子: 28
注册时间: 2007-08-07 22:43

我的

#9

帖子 amagle » 2007-08-17 13:03

# /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


我的好怪啊,和你们的怎么差那么多啊
水至清则无鱼.

人至贱则无敌.
头像
qianjigui
帖子: 221
注册时间: 2007-06-26 23:50
来自: WHU
联系:

#10

帖子 qianjigui » 2007-08-27 21:25

代码: 全选

# ~/.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
####################################################################
sailingburg
帖子: 19
注册时间: 2008-11-29 0:33

Re:

#11

帖子 sailingburg » 2009-08-28 8:58

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 这行命令是什么意思?“:”和“$”是什么意思?
回复