Xref: utzoo comp.unix.questions:29584 comp.unix.programmer:1370 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!wciu!george From: george@wciu.wciu.edu (George Peavy) Newsgroups: comp.unix.questions,comp.unix.programmer Subject: determining port id Message-ID: <1991Mar19.171708.18628@wciu.EDU> Date: 19 Mar 91 17:17:08 GMT Sender: George Peavy Followup-To: comp.unix.questions, george@wciu.edu Organization: William Carey International University Lines: 24 I'm still learning shell programming, and have hit a snag that, so far, I haven't been able to figure out. Here's what's happening: I'm writing a menu program that, among other things, allows a user to select the option of up/downloading files to/from a PC. Since I also have terminals attached, I want to disallow this option unless the user is working from a port known to have a pc attached to it. 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 }' The question is, how do I get this information into a place where I can test the value? Is there a simpler way than my use of awk? posted(and I hope I've gotten the right group for followup) and email replies both welcomed. Thanks in advance. -- George Peavy (george@wciu.edu)