$cwd in prompt???
Simon McClenahan
simonm at mel.dit.csiro.au
Tue Jun 18 16:47:31 AEST 1991
In article <JC.91Jun18021304 at raven.bu.edu>, jc at raven.bu.edu (James Cameron) writes:
|> >>>>> On 18 Jun 91 03:41:07 GMT, bjsvec at 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 at mel.dit.csiro.au |
| Waste not what I want... |
More information about the Comp.unix.questions
mailing list