home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- 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
- From: martin@datacomm.ucc.okstate.edu (Martin McCormick)
- Subject: Re: Running "dd" from .profile
- Message-ID: <1992Nov11.221045.19486@osuunx.ucc.okstate.edu>
- Keywords: dd .profile
- Sender: news@osuunx.ucc.okstate.edu (USENET News System)
- Nntp-Posting-Host: datacomm.ucc.okstate.edu
- Organization: Oklahoma State University, Stillwater, OK
- References: <1992Nov11.172927.6700@mnemosyne.cs.du.edu>
- Distribution: usa
- Date: Wed, 11 Nov 1992 22:10:45 GMT
- Lines: 19
-
- In article <1992Nov11.172927.6700@mnemosyne.cs.du.edu> sscrivan@nyx.cs.du.edu (steve scrivano) writes:
- >Can anyone tell me how to write a script that could be placed in the user's
- >.profile file that would check which /dev/tty port I am logged into and pass
- >that variable to a "dd" command line that is placed in the .profile file which
- >would then execute upon login.
-
- If you want to keep things simple, you might pipe the output of the "who"
- command through awk or nawk and locate the user by matching all of the
- output lines with the "whoami" variable. I am leaving this as an exercise
- for the user, because there are a couple of nasty little problems which will
- need attention before the script is bullet-proof. You will need to resolve
- what to do with a user who is already logged in to 15 or 16 other sessions
- and has just logged in, again.
- Also, it would be helpful, later, to have this script as a separate
- shell script so that it can be better understood, two years later, when
- it needs modification. Good luck.
-
- Martin McCormick WB5AGZ Stillwater, OK
- O.S.U. Computer Center Data Communications Group
-