Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!mips!daver!genco!rad From: rad@genco.bungi.com (Bob Daniel) Newsgroups: comp.unix.questions Subject: Re: determining port id Message-ID: <585@genco.bungi.com> Date: 21 Mar 91 18:20:20 GMT References: <1991Mar19.171708.18628@wciu.EDU> Reply-To: rad@genco.bungi.com (Bob Daniel) Organization: Gentry & Assoc. Excelsior Springs, MO Lines: 17 In article <1991Mar19.171708.18628@wciu.EDU> george@wciu.wciu.edu (George Peavy) writes: > >What I have so far: I'm using Bourne shell on AT&T Sys V 3.0 running on a >Unisys 6000/51 platform. I can get the port id with, > > who am i | awk '{ print $2 }' > This is how I do it... device=`tty` port=`basename $device` echo $port The "`" are accent marks, not single quotes. I'm on AT&T SysV 3.2.3. This is also more accurate than using 'who am i' when using 'layers'.