Return to BSD News archive
Xref: sserve comp.unix.user-friendly:2810 comp.unix.solaris:21975 comp.unix.programmer:19625 comp.unix.misc:13687 comp.unix.aux:15232 comp.unix.bsd:14754 comp.unix.aix:43243 Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!ihnp4.ucsd.edu!dog.ee.lbl.gov!agate!ames!newsfeed.gsfc.nasa.gov!jagubox!jim From: jim@jagubox.gsfc.nasa.gov (Jim Jagielski) Newsgroups: comp.unix.user-friendly,comp.unix.solaris,comp.unix.programmer,comp.unix.misc,comp.unix.aux,comp.unix.bsd,comp.unix.aix Subject: Re: Shell wars (Re: xargs and alias commands) Date: 26 Aug 94 14:25:41 GMT Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Lines: 21 Distribution: inet Message-ID: <3553@jagubox.gsfc.nasa.gov> References: <33af70$8rd@usenet.INS.CWRU.Edu> <33eevl$eja@hamlet.umd.edu> <33gvms$56a@wombat.cssc-syd.tansu.com.au> <33iajo$ibg@sprocket.csv.warwick.ac.uk> <33jkb2$6ev@hamlet.umd.edu> Reply-To: jim@jagubox.gsfc.nasa.gov (Jim Jagielski) NNTP-Posting-Host: jagubox.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit brewer@hamlet.umd.edu (Peter Brewer) writes: >alias cd 'set old=$cwd; chdir \!*; set back=$cwd:h; set prompt=$hostname\[$back: >t/$cwd:t\].\!\ ' Well, ksh doesn't support alias arguments, which is a major pain, so the above can't be written. However, if you want, you can write a function that does the above (Boo!) or simply recall that '~-' is the previous directory (which takes care of 'set old...'), and that PS1 can be set to PS1='[${PWD#${PWD%/*/*}/}]! ' which takes care of 'set prompt'... :) -- #include <std/disclaimer.h> | Jim Jagielski | jim@jagubox.gsfc.nasa.gov | V: 301 286-5964 | | NASA/GSFC, Code 734.4 | Greenbelt, MD 20771 | F: 301 286-1719 | << I want my TWO DOLLARS !! >> -- The paperboy