🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1652

Re: Built-in String Processing?

#1652
From: John P. Kole
Date: Sun, 28 Oct 1990 04:30
11 lines
886 bytes
In article <1990Oct27.215051.14085@midway.uchicago.edu> phd_ivo@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}> "'
Technical Details
Message-ID: <107803@convex.convex.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!convex!kole
References: <1990Oct27.215051.14085@midway.uchicago.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!convex!kole
From: kole@convex.com (John P. Kole)
Newsgroups: comp.unix.shell
Subject: Re: Built-in String Processing?
Message-ID: <107803@convex.convex.com>
Date: 28 Oct 90 04:30:33 GMT
References: <1990Oct27.215051.14085@midway.uchicago.edu>
Sender: usenet@convex.com
Organization: Convex Computer Corporation, Richardson, Tx.
Lines: 11