term enhancements...

Dimitrios P. Bouras dbouras at hol.gr
Wed Aug 26 18:25:07 EEST 1998


Giannis Economou wrote:
> 
> Epishs, kati pio aplo, pos kaneis to shell-prompt sou na sou grafei to pwd 'h kati san "username:pwd>"?

To parakatw (me oti pros0etes allages 0es) kanei th douleia sto
bash shell (parathrhsh: opoion xarakthra blepeis me '^' mprosta
sto parakatw einai control xarakthras kai prepei na ton grapseis
p.x. me ton vi kai patwntas Ctrl-V kai meta ton xarakthra --
paradeigma, to "^[" bgainei patwntas Ctrl-V kai meta Esc):

---------------------------------------------------------------
if [ "$TERM" = "xterm" ]; then  # X-Windows
  alias Dirs='dirs | sed -e s/" "/"   "/g'
  Banner="`hostname` (`whoami`)"
  PROMPT_COMMAND='echo -n "^[]2;"$Banner":  `Dirs`^G"'
  PS1='\$ '
else                            # No windows
  if [ "$SHELL" = "/bin/pdksh" -o "$SHELL" = "/bin/ksh" ]; then
    PS1="! $ "
  elif [ "$SHELL" = "/bin/zsh" ]; then
    PS1="%m:%~%# "
  elif [ "$SHELL" = "/bin/ash" ]; then
    PS1="$ "
  else
    PS1='\h:\w\$ '
  fi
fi
PS2='> '
---------------------------------------------------------------

To antistoixo script fragment pou xrhsimopoiw gia csh/tcsh einai
to parakatw (ta idia pou eipa gia tous control xarakthres isxyoun
kai edw fysika :)):

---------------------------------------------------------------
if ( $TERM == "xterm" ) then    # X-Windows
   alias Dirs        'dirs | sed -e s/" "/"   "/g'
   set Banner="`hostname` (`whoami`)"
   alias WriteBanner 'echo -n "^[]2;"$Banner":  `Dirs`^G"'
   alias cd          "cd \!* ; WriteBanner"
   alias pushd       "pushd \!* ; WriteBanner"
   alias popd        "popd ; WriteBanner"
   alias pwd         "pwd ; WriteBanner"
   cd
   alias sub "\su     \!*; echo ' '; WriteBanner"
   alias rl  "\rlogin \!*; echo ' '; WriteBanner"
   set prompt = "% "
else                            # No windows
   if ( "$shell" == "tcsh" ) then
      set prompt="%m:$cwd % "
   else
      alias SetPr 'set prompt="`hostname`:$cwd % "'
      SetPr
      alias cd      'chdir \!* && SetPr'
      alias pushd   'pushd \!* && SetPr'
      alias popd    'popd \!* && SetPr'
      alias pwd 'pwd \!* && SetPr'
   endif
   alias rl '\rlogin'
   alias sub '\su'
endif
---------------------------------------------------------------

Me xairetismous,

Dhmhtrhs
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list