Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!sc.intel.COM!SEDAYAO From: SEDAYAO@sc.intel.COM (Jeff Sedayao - Intel Santa Clara Postmaster) Newsgroups: comp.os.vms Subject: Re: getting current directory in dcl prompt Message-ID: <8802091137.AA21315@ucbvax.Berkeley.EDU> Date: 29 Jan 88 16:21:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 29 Here is what I do in a command procedure called cd.com to put the node name and current directory into the prompt. I trim the directory name so my prompt does not take up the whole line. Jeff Sedayao -----------------------CD.COM Cut Here------------------------ $ ON WARNING THEN EXIT $ NODE=F$GETSYI("NODENAME") $ IF P1.EQS."" THEN GOTO A2 $ SET DEF 'P1' $ P1=F$ENVIRONMENT("DEFAULT") $ IF F$LENGTH(P1) .LE. 23 THEN GOTO A1 $ PR1=F$EXTRACT(0,23,P1) $ P1=PR1 $ A1: $ TEMP="SET PROMPT="+NODE+"::"+P1+">" $ TEMP $ EXIT $ A2: $ SET DEF SYS$LOGIN $ P1=F$ENVIRONMENT("DEFAULT") $ TEMP="SET PROMPT="+NODE+"::"+P1+">" $ TEMP $ EXIT -------