Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!mel.dit.csiro.au!simonm From: simonm@mel.dit.csiro.au (Simon McClenahan) Newsgroups: comp.unix.questions Subject: Re: $cwd in prompt??? Message-ID: <1991Jun18.064731.27232@mel.dit.csiro.au> Date: 18 Jun 91 06:47:31 GMT References: <17153@darkstar.ucsc.edu> Sender: usenet@mel.dit.csiro.au (usenet mail contact) Reply-To: simonm@mel.dit.csiro.au (Simon McClenahan) Distribution: comp.unix.questions Organization: CSIRO DIT (Melb.) Lines: 33 In article , jc@raven.bu.edu (James Cameron) writes: |> >>>>> On 18 Jun 91 03:41:07 GMT, bjsvec@cats.ucsc.edu (Brandon Jason Svec) said: |> ||> Can someone tell me how to get my prompt to show the current working |> ||> directory? |> ||> I have tried something like this: |> ||> alias cd "cd;set prompt = $cwd" # so it will update each time I cd |> ||> set prompt = $cwd |> |> Well, a basic solution to this would be this alias which could go in |> either your .alias file if you have one, or .login: |> |> alias cd 'cd \!*;set prompt = "$HOST [$cwd] % "' |> |> which gives me when I am in my home directory: |> |> raven [/u4/home/jc] % |> I have this in my .cshrc .... a setprompt 'set prompt="[`hostname`:`pwd` -\\!] " ' setprompt a cd 'chdir \!* && setprompt ; ls -r -t' of course, the ls -r -t is just a nice reverse-time listing, which is usually the first think I want to do when I change directories -- |Simon McClenahan CSIRO, | Cray Supercomputing Support Group | |55 Barry St, Carlton, | (TEL) +61 3 347 8644 (FAX) +61 3 347 8987 | |VIC 3053, Australia | Internet:simonm@mel.dit.csiro.au | | Waste not what I want... |