Jump to...
redirecting...

Log for Ubuntu 台灣社群

Thanks MR James Alfred, I just want to thank you for making me feel better and better each and every day. You are a blessing to my life. ever since I start trading with you have been receiving my profit without any complain my fellow investor don't fall into the hands of scammers contact MR James Alfred for you to testify like others he is the best account manager you can trust, contact him Vai,,,,,,,,
https://t.me/joinchat/AAAAAEhii2_BM_SwHJoINQ
系統快照/備份: timeshift
把系統做成live USB: cubic/systemback
然後自己的環境就推到自己的 gitea 上
I can’t begin to express my gratitude. @Davidmurphy1 made my life absolutely perfect. I invested $1000 and got $9050! He takes the extra time to make sure you understand what he's doing for you, which was huge for someone like myself (someone that doesn’t know a thing about Bitcoin !). Take comfort in knowing, working with @Davidmurphy1 is like having a friend who has your back. Thanks for going above & beyond for me, @Davidmurphy1
Contact him on this link below
👇👇👇👇👇
https://t.me/joinchat/AAAAAFPKz07ixcxuZ0z8hg
!bang
!bang
謝謝大家回答😀😀
如果我定義 bash 函數

想要每次執行 cd 指令 就 就執行該函數該怎麼做

原本想說 取同名字的 cd 函數
結果似乎會進去 無窮迴圈
想讓 cd 改成下面的效果
但用 alias 辦不到
有其他方法嘛?
cd ~/path && PS1="$RED[\A]$NO_COLOR $GREEN\u@\h$BWhite:$Cyan\w $YELLOW$(parse_git_branch)$NO_COLOR\$ "
希望可以 cd 進去 有 git 的目錄時
會出現 branch
[photo](media:AgACAgUAAx0CPRn5XQAC621elGGd-kSj69MgT7lTyqIUR63RKQAC9akxG0RboFQ5Y8z0oTF-sgiwJTMABAEAAwIAA20AA9zMBQABGAQ@telegram)
用zsh
keyword: git bash branch name
網路上可以找到的方法 都是 只有當下bash開啟 才會解析 git 到 ps1
我想要每次 cd 都解析
沒有吧
[photo](media:AgACAgUAAx0CPRn5XQAC63NelGQ4ewABpaBL2oi0RMfp3ELoSg0AAvapMRtEW6BUGw4F2KXEX-d94L5qdAADAQADAgADbQAD75MAAhgE@telegram)
我的不行耶...
[photo](media:AgACAgUAAx0CPRn5XQAC63VelGZe9KLLPBuKD3WW_6o7dCooLQAC96kxG0RboFRKoo69RsBUtfW-JTMABAEAAwIAA20AA7HLBQABGAQ@telegram)
你是怎麼做的…
在 .bahsrc 加入以下
# show git branch
function parse_git_branch () {
  git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/(\1)/"
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BIPurple="\[\033[1;95m\]"
Cyan="\[\033[1;36m\]"
NO_COLOR="\[\033[00m\]"
BWhite="\[\033[1;37m\]"
PS1="$RED[\A]$NO_COLOR $GREEN\u@\h$BWhite:$Cyan\w $YELLOW$(parse_git_branch)$NO_COLOR\$ "
[photo](media:AgACAgUAAx0CPRn5XQAC63helGbo9bczAw_m3FsIX2Cg6QwrZQAC-KkxG0RboFSVPUsnVENGJ7OyJTMABAEAAwIAA20AAwPPBQABGAQ@telegram)
你試試這個
git_prompt() {
foreLightGreen="\[\033[1;32m\]"
foreRed="\[\033[1;31m\]"
foreBlue="\[\033[1;34m\]"
colorOff="\[\033[0m\]"
user="${foreLightGreen}\u${colorOff}"
cwd="${foreBlue}\w${colorOff}"
echo "${user} ${cwd}${foreRed}\$(__git_ps1) ${colorOff}\$ "
}
PS1=$(git_prompt)
可以了
原來是
$(parse_git_branch)
前面少 \
謝謝
[sticker](media:AAMCBQADHQI9GfldAALrfF6UaNwPaHkIomlVUsCJ_PAjkYJxAAInEAAClun9CfM9wlj5nme8t33KMgAEAQAHbQADUEQAAhgE@telegram)