Xref: utzoo comp.unix.shell:2152 comp.lang.perl:5279 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!aspect!dave From: dave@aspect.UUCP (Dave Corcoran) Newsgroups: comp.unix.shell,comp.lang.perl Subject: Re: ksh & perl approach to pruning long pwd prompts Summary: how about ${PWD#$HOME/} Message-ID: <9959@aspect.UUCP> Date: 9 May 91 15:53:35 GMT References: <1991Apr25.122017.3868@ttsi.lonestar.org> Followup-To: comp.unix.shell Organization: Aspect Telecommunications, San Jose, Ca Lines: 23 In article <1991Apr25.122017.3868@ttsi.lonestar.org>, root@ttsi.lonestar.org (System) writes: > A recent spate of articles (in comp.unix.shell) about pwd style Which I missed so forgive me if this has been proposed. > A really long path is shortened by successively pruning leading path > components until the length is less than a user-specified size. > Pruned components are replaced with "..." as in > Any suggestions for how to do this in ksh are welcome. Likewise for > improved perl code. Although this will not limit of the prompt to a specified size it is terse. PS1='${PWD#$HOME/}' You could substitute $DIR for $HOME and then set DIR to the leading path you want trimmed. -- David Corcoran -@@ uunet!aspect!dave ~ Having the right to do something is not the same as being right in doing it. -- C.K. Chesterson