Built-in String Processing?

John P. Kole kole at convex.com
Sun Oct 28 15:30:33 AEST 1990


In article <1990Oct27.215051.14085 at midway.uchicago.edu> phd_ivo at gsbacd.uchicago.edu writes:
> ...
>	alias cd                'cd \!* && set prompt="\! ${cwd}> "'
> ...
>'/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?

Try the ':t' modifier as follows:

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



More information about the Comp.unix.shell mailing list