Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!jarthur!bridge2!3comvax!tymix!tardis!jms From: jms@tardis.Tymnet.COM (Joe Smith) Newsgroups: comp.unix.shell Subject: Re: Built-in String Processing? Summary: Use :t once or twice. Message-ID: <1316@tardis.Tymnet.COM> Date: 30 Oct 90 23:04:28 GMT References: <1990Oct27.215051.14085@midway.uchicago.edu> Reply-To: jms@tardis.Tymnet.COM (Joe Smith) Organization: BT Tymnet, San Jose, CA Lines: 18 In article <1990Oct27.215051.14085@midway.uchicago.edu> phd_ivo@gsbacd.uchicago.edu writes: > alias cd 'cd \!* && set prompt="\! ${cwd}> "' >Unfortunately, this gives me a rather long string. Use $variable:t to get the tail (the name after the last "/") and use $variable:h to get the head (everything before the last "/"). alias cd 'cd \!*; set cwdh=$cwd:h; set prompt="($cwdh:t/$cwd:t) $myprompt"' alias pushd 'pushd \!*; cd .' alias popd 'popd \!*; cd .' Or go read the Frequently Asked Questions posting in the "newuser" and "announce" newsgroups. -- Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms PO Box 49019, MS-C41 | BIX: smithjoe | 12 PDP-10s still running! "POPJ P," San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."