Ignore:
Timestamp:
07/30/2007 07:23:41 PM (17 years ago)
Author:
Ag Hatzimanikas <ag@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 6.3, 6.3-rc1, 6.3-rc2, 6.3-rc3, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
51fc891
Parents:
c7f6bfd7
Message:

Removed the extra-prompt.sh script and modifications to PS1 variable

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6991 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/config/profile.xml

    rc7f6bfd7 r0d7ec6f1  
    141141export HISTSIZE=1000
    142142export HISTIGNORE="&amp;:[bf]g:exit"
    143 #export PS1="[\u@\h \w]\\$ "
    144 export PS1='\u@\h:\w\$ '
     143
     144# Setup a red prompt for root and a green one for users.
     145NORMAL="\[\e[0m\]"
     146RED="\[\e[1;31m\]"
     147GREEN="\[\e[1;32m\]"
     148if [[ $EUID == 0 ]] ; then
     149  PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
     150else
     151  PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
     152fi
    145153
    146154for script in /etc/profile.d/*.sh ; do
     
    296304    </sect3>
    297305
    298     <sect3 id="extra-prompt.sh">
    299       <title>/etc/profile.d/extra-prompt.sh</title>
    300 
    301       <indexterm zone="postlfs-config-profile extra-prompt.sh">
    302         <primary sortas="e-etc-profile.d-prompt.sh">/etc/profile.d/extra-prompt.sh</primary>
    303       </indexterm>
    304 
    305       <para>This script shows an example of a different way of setting the
    306       prompt.  The normal variable, <envar>PS1</envar>, is supplemented by
    307       <envar>PROMPT_COMMAND</envar>. If set, the value of
    308       <envar>PROMPT_COMMAND</envar> is executed as a command prior to issuing
    309       each primary prompt.  The sequence \e is an ESC character.  \a is a
    310       BEL character.  For a reference on <command>xterm</command> escape
    311       sequences, see <ulink
    312       url="http://rtfm.etla.org/xterm/ctlseq.html"/>.</para>
    313 
    314 <screen role="root"><userinput>cat &gt; /etc/profile.d/extra-prompt.sh &lt;&lt; "EOF"
    315 <literal>PROMPT_COMMAND='echo -ne "\e[1m${USER}@${HOSTNAME} : ${PWD}\e[0m\a"'
    316 export PROMPT_COMMAND</literal>
    317 EOF</userinput></screen>
    318 
    319     <para>The escape sequences above are BOLD, NORMAL, and BEL.</para>
    320 
    321     </sect3>
    322 
    323306    <sect3 id="i18n.sh">
    324       <title>'/etc/profile.d/i18n.sh'</title>
     307      <title>/etc/profile.d/i18n.sh</title>
    325308
    326309    <indexterm zone="postlfs-config-profile i18n.sh">
     
    385368# addendum.]
    386369
    387 #export PS1="[\u@\h \w]\\$ "
    388 export PS1='\u@\h:\w\$ '
     370NORMAL="\[\e[0m\]"
     371RED="\[\e[1;31m\]"
     372GREEN="\[\e[1;32m\]"
     373if [[ $EUID == 0 ]] ; then
     374  PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
     375else
     376  PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
     377fi
    389378
    390379# End /etc/bashrc</literal>
Note: See TracChangeset for help on using the changeset viewer.