回文章列表
作者myCrystal.bbs@ptt.cc ( ) 看板: linux
標題Re: [問題] 提示目前所在目錄
時間批踢踢實業 (2008/05/26 Mon 15:10:42)
※ 引述《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

--
※ 發信站: 批踢踢實業坊(ptt.cc) 
◆ From: 140.113.166.28
文章選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻