Built-in String Processing?

phd_ivo at gsbacd.uchicago.edu phd_ivo at gsbacd.uchicago.edu
Sun Oct 28 08:45:33 AEST 1990


*************

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 at next.agsm.ucla.edu



More information about the Comp.unix.shell mailing list