Thread: Unix probelm--can you help me?

  1. #1
    Registered User jacktibet's Avatar
    Join Date
    Mar 2003
    Posts
    18

    Question Unix probelm--can you help me?

    I want to write a shell script which will lock the terminal and prevent other people from using it. It must prompt your twice to entry a key, if the keys match, it should sit in a loop prompting a user to enter a third key. If the keymatches the ones you entered the script should exit to the shell prompt. If i enter the wrong key 5 time, the system will log off.
    -----------------------------------------------------------------------------------
    I think i cannot use vlock here.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    102
    What shell are you doing this in and why should we do your hw? Why not post what you already have and then we MIGHT help you debug it.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    102
    Ill see what I can do when I get home

    But what you gave should give him a good idea. For his HW

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Code:
    newt.c_cc[VQUIT]  = 0;
    Does this disable the quit control character or set it to 0?

    Can't you enter ascii-code 0 using alt and keypad? Or cntrl-@?

    I currently don't have a linux box running to "see if I can break it". (Did I break it?)

    You could disable the checking of control characters all together by by removing ISIG from c_lflag as well.

    gg

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    102
    vVv no I was not tyring to make you feel guily I though you didnt see it I'm my first post. sorry.

  6. #6
    Registered User jacktibet's Avatar
    Join Date
    Mar 2003
    Posts
    18

    Unhappy

    'vlock' utility can lock the terminal. but if i use it. It propmt to input the user's pin.If the user's pin is incorrect, it prompt to input the root's pin.So i cannot display any other information until i input the correct pin.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to program in unix
    By Cpro in forum Linux Programming
    Replies: 21
    Last Post: 02-12-2008, 10:54 AM
  2. Setting up a Unix box
    By @nthony in forum Tech Board
    Replies: 6
    Last Post: 07-22-2007, 10:22 PM
  3. UNIX (Linux, BSD, etc) Programming :: UNIX
    By kuphryn in forum Linux Programming
    Replies: 6
    Last Post: 04-01-2004, 08:44 PM
  4. Unix Sockets
    By prvindia in forum Linux Programming
    Replies: 5
    Last Post: 03-11-2003, 09:16 AM
  5. About Unix Programming - Making a career desision
    By null in forum C Programming
    Replies: 0
    Last Post: 10-14-2001, 07:37 AM