Re: git branch help?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 3, 2010 at 2:16 PM, Thomas Spura <tomspur@xxxxxxxxxxxxxxxxx> wrote:
> function bash_git_branch
> {
>  git branch 2> /dev/null | grep \* | awk '{print $2}'
> }
>
> export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[31m\]
> $(bash_git_branch)\[\033[01;34m\]\$\[\033[00m\] '
>
> So no need to call python, if awk is enought :)
>

No need to call grep either - awk is enough

git branch 2>/dev/null | awk '/^\*/{print $2}'

-- 
Iain.
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux