Path: utzoo!utgpu!water!watmath!clyde!rutgers!mcnc!decvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.os.vms Subject: Re: getting current dir in dcl prompt Message-ID: <2660@enea.se> Date: 30 Jan 88 18:03:23 GMT References: <8801281127.AA17941@ucbvax.Berkeley.EDU> Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.os.vms Organization: ENEA DATA AB, Sweden Lines: 42 (Tried to mail, but letter bounced) >Hi, > > The logical thing to do would be: > >$TEMP = "show default" >$SET PROMPT = 'TEMP' Wouldn't it be more simple to do just SET PROMPT = "SHOW DEFAULT" That would give the expected result :-) > There was/is a similar discussion going on in unix-wizards >where: > >set prompt 'pwd' (I think?) seemed to do the trick. I don't know if this makes Unix to recalculate the prompt everytime, but a such a thing is not available in VMS. The prompt is only changed on demand. > Has anyone else come up with a solution? Try this one. You use it instead of SET DEFAULT. As prompt you get the name of the current directory, the parent directories are excluded. $ Set def 'p1' $ curr_dir = f$dir() $ curr_dir = f$extract(1, f$length(curr_dir)-2, curr_dir) + "> " $ i = 0 $loop: $ subdir = f$element(i, ".", curr_dir) $ i = i + 1 $ if f$locate(">", subdir) .eq. f$length(subdir) then $ goto loop $ set prompt="''subdir'" -- Erland Sommarskog ENEA Data, Stockholm "Will you remember president Reagan sommar@enea.UUCP will you rememeber all the bills we'll have to pay or even yesterday, tomorrow?" - David Bowie