It is currently Thu, 20 Jan 2022 04:06:24 GMT

Author Message
 quoting for prompt or xterm title in csh

I want to set prompt or xterm title to working directory in csh.
However, because the path sometimes becomes too long, I'd like to
replace my home directory with a '~'.  But the best I can do is
getting '\~' instead of '~' with the following lines in my .cshrc

  alias npwd 'set npwd=`echo $cwd | sed "s|${HOME}|\\~|"`'
  if (${TERM} == "xterm") then
    alias sp 'npwd;echo -n "^[]0;${HOST}:${USER}:$npwd ^G"'
    set prompt="{!} "
    alias sp 'npwd;set prompt="${USER}@${HOST}:$npwd{!} "'
  alias cd 'cd \!* ; sp '

Without double backslashs in front of '~', shell just replaces
home dir with home dir itself.  How can I proper quote '~' so that
I can get a clean '~' in place of my home dir?

Miinshiou Huang              Tel: 313-317-4992      Fax: 313-845-4220
Work:                  Home:

 Mon, 21 Oct 2002 03:00:00 GMT   
   [ 1 post ] 

Similar Threads

1. tcsh xterm title bar quoting

2. change xterm title from unix prompt

3. Using tcsh prompt string in xterm title

4. Display ksh prompt in xterm title problem

5. Prompt string to change xterm title?

6. xterm titles in tcsh (or csh)

7. Show dynamic path on xterm bar and prompt for csh

8. Reverse-video csh prompt on SunOS xterm?

9. csh prompt (csh newbie)

10. prompt in Title Bar

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software