Path: utzoo!utgpu!watserv1!watmath!att!ucbvax!ucsd!usc!cs.utexas.edu!harley From: harley@cs.utexas.edu (Harley Hahn) Newsgroups: comp.unix.i386 Subject: finding out what terminal you are logged into under VP/ix Message-ID: <9900@cs.utexas.edu> Date: 10 Jul 90 22:18:57 GMT Organization: -- Lines: 25 Here is a neat trick. I wanted to set my DOS prompt under VP/ix to tell me what terminal I was logged in to. However, there is no way to directly access this information from DOS and there is no way (that I could find) to set a DOS variable from Unix. But, here's how you can do it. Create a directory, call it, say, WHEREAMI. In your AUTOEXEC file, change to WHEREAMI and delete all the files. Then, execute the following Unix command. Even though it is in a DOS batch file, VP/ix will make it work: touch `basename \`tty\`` This will create a file with the name of your terminal, VT01, VT02, CONSOLE, or whataver. Next, use the IF EXIST statement to find which of these files exists and set the prompt accordingly. I have tested this and it works.