🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1638

Built-in String Processing?

#1638
From: phd_ivo
Date: Sat, 27 Oct 1990 21:45
13 lines
965 bytes
*************

I am running a csh with enhancements on my NeXT and on an HP-9000/8xx.
I have a macro to define my prompt to be the current directory, i.e.

	alias cd                'cd \!* && set prompt="\! ${cwd}> "'

Unfortunately, this gives me a rather long string, which starts with
'/Users/u/ivo/subdir' etc. I would like to get rid of the first x characters of
the ${cwd} variable in this macro, i.e. display only 'subdir' ( or even better,
only if the string starts with '/Users/u/ivo' ). How would I do this?

/ivo welch	ivo@next.agsm.ucla.edu
Technical Details
Message-ID: <1990Oct27.215051.14085@midway.uchicago.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!wuarchive!uwm.edu!linac!midway!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!wuarchive!uwm.edu!linac!midway!news
From: phd_ivo@gsbacd.uchicago.edu
Newsgroups: comp.unix.shell
Subject: Built-in String Processing?
Message-ID: <1990Oct27.215051.14085@midway.uchicago.edu>
Date: 27 Oct 90 21:45:33 GMT
Sender: news@midway.uchicago.edu (News Administrator)
Organization: University of Chicago Graduate School of Business
Lines: 13