home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / question / 13256 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.8 KB  |  34 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!darwin.sura.net!convex!constellation!osuunx.ucc.okstate.edu!datacomm.ucc.okstate.edu!martin
  3. From: martin@datacomm.ucc.okstate.edu (Martin McCormick)
  4. Subject: Re: Running "dd" from .profile
  5. Message-ID: <1992Nov11.221045.19486@osuunx.ucc.okstate.edu>
  6. Keywords: dd .profile
  7. Sender: news@osuunx.ucc.okstate.edu (USENET News System)
  8. Nntp-Posting-Host: datacomm.ucc.okstate.edu
  9. Organization: Oklahoma State University, Stillwater, OK
  10. References: <1992Nov11.172927.6700@mnemosyne.cs.du.edu>
  11. Distribution: usa
  12. Date: Wed, 11 Nov 1992 22:10:45 GMT
  13. Lines: 19
  14.  
  15. In article <1992Nov11.172927.6700@mnemosyne.cs.du.edu> sscrivan@nyx.cs.du.edu (steve scrivano) writes:
  16. >Can anyone tell me how to write a script that could be placed in the user's
  17. >.profile file that would check which /dev/tty port I am logged into and pass
  18. >that variable to a "dd" command line that is placed in the .profile file which
  19. >would then execute upon login.
  20.  
  21. If you want to keep things simple, you might pipe the output of the "who"
  22. command through awk or nawk and locate the user by matching all of the
  23. output lines with the "whoami" variable.  I am leaving this as an exercise
  24. for the user, because there are a couple of nasty little problems which will
  25. need attention before the script is bullet-proof.  You will need to resolve
  26. what to do with a user who is already logged in to 15 or 16 other sessions
  27. and has just logged in, again.
  28.     Also, it would be helpful, later, to have this script as a separate
  29. shell script so that it can be better understood, two years later, when
  30. it needs modification.  Good luck.
  31.  
  32. Martin McCormick WB5AGZ   Stillwater, OK
  33. O.S.U. Computer Center Data Communications Group
  34.