<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I've tried the changes, i.e. the "sleep" & removing the "done" but
I get the same error message "syntax error: unexpected end of file" WHY
!!!!! <span class="moz-smiley-s6"><span> :-[ </span></span><br>
Second how could the script be modified, once it works, to be applied
only to a group of users?<br>
<br>
thanks for all the help<br>
<br>
norbert<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:sysadmin@handsworth.bham.sch.uk">sysadmin@handsworth.bham.sch.uk</a> wrote:
<blockquote cite="mid200409220849.52896.sysadmin@handsworth.bham.sch.uk"  type="cite">
  <pre wrap="">On Tuesday 21 Sep 2004 4:33 pm, norbert wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Martin,

Thanks I'm trying the script but I've run into two problems;

1) After changeing the paths for linux and adding a ";" and "done"
please see code

# This user is only allowed a single login instance
tty=`/usr/bin/tty`     # Get tty to test for multiple login

if /bin/ps -u $LOGNAME | /bin/grep -v UID | /bin/grep -v "${tty##/dev/}" ;
then
       /bin/cat <<-EOM >&2

       You already have an active session on this system and you are
       allowed a single session.  This session will now be closed.

       EOM
       wait
       exit
fi
done

I saved the script and tried running it alone I get  "line 16: syntax
error: unexpected end of file" can the error be clarified and corrected
please as it looks correct ......
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Looks to me it is the done causing your problems.  Typical syntax is :-
for f in `ls` ; do
  something
done
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">Second where do I put this scrip in /etc/profile ? or as an independent
executable ??
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Nup; just chuck the code on the end of /etc/profile.  You should probably 
change the wait to a sleep 2 otherwise your message won't be visible.  You 
should also possibly bypass this code for select users (root might be a good 
one) and be sure to stay logged in while you are fiddling with /etc/profile 
(ie test it using a different console).

  </pre>
</blockquote>
</body>
</html>