提示目前所在目錄 - Linux

By Aaliyah
at 2008-05-26T15:10
at 2008-05-26T15:10
Table of Contents
※ 引述《MOONRAKER (㊣烏笨禿,又笨又禿)》之銘言:
: ※ 引述《myCrystal ( )》之銘言:
: : 我是用Ubuntu 8。
: : 除了一開始create 的帳號,在console會有顯示目前路徑以外,
: : 其他useradd的帳號 不管進入那一個directory,都只有一個$當作提示
: : 想請問一下 有辦法讓他像root那樣,顯示完整目前path嗎?
: : 謝謝
: 看你的$PS1設定什麼,在/etc/profile裡面照著設定就好了。
:
請問
我把profile改成
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
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="[\u@\h:\w]\$ "
fi
fi
fi
umask 022
是改紅色line,結果
提示字元卻變成 : [\u@\h:\w]$
這是怎麼回事?
thanks
--
: ※ 引述《myCrystal ( )》之銘言:
: : 我是用Ubuntu 8。
: : 除了一開始create 的帳號,在console會有顯示目前路徑以外,
: : 其他useradd的帳號 不管進入那一個directory,都只有一個$當作提示
: : 想請問一下 有辦法讓他像root那樣,顯示完整目前path嗎?
: : 謝謝
: 看你的$PS1設定什麼,在/etc/profile裡面照著設定就好了。
:
請問
我把profile改成
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
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="[\u@\h:\w]\$ "
fi
fi
fi
umask 022
是改紅色line,結果
提示字元卻變成 : [\u@\h:\w]$
這是怎麼回事?
thanks
--
Tags:
Linux
All Comments
Related Posts
Can't open file for writing

By Todd Johnson
at 2008-05-26T14:49
at 2008-05-26T14:49
Can't open file for writing

By Ethan
at 2008-05-26T14:45
at 2008-05-26T14:45
Can't open file for writing

By Regina
at 2008-05-26T14:32
at 2008-05-26T14:32
Can't open file for writing

By Quanna
at 2008-05-26T14:24
at 2008-05-26T14:24
挑戰Solaris下寫程式

By James
at 2008-05-26T11:01
at 2008-05-26T11:01