Re: get the number of user

From: Chris F.A. Johnson (c.f.a.johnson@rogers.com)
Date: 04/08/03


From: "Chris F.A. Johnson" <c.f.a.johnson@rogers.com>
Date: 8 Apr 2003 05:10:41 GMT

On Tue, 08 Apr 2003 at 04:14 GMT, Jun wrote:
> thanks.
> I am installing now.
> actually, I have one more question.
>
> wrote server and client program like these:

    What server program?

> #!/bin/sh
>
> echo "There are `who | wc -l` users on this system."

    This just tells you how many people are on the machine that's
    running the script, not a remote computer.

> client program:
> #!bin/sh
>
> if [ $# = 1 ]
> then
> echo "You need one argument : file "
> exit 1
> fi
>
> cmd=$0
> filename=$1
>
> while read -r address
> do
> array[0]=$address

   What's the array for? You don't use it.

> telnet $address 80 | myserver

   What is this supposed to do?

> done < $1
>
> also, the hostaddress.txt is
> www.yahoo.ca
> www.cbc.ca
> www.sasktel.com
> www.shaw.ca
> www.google.ca
> www.hotmail.com
> www.futureshop.ca
> ca.msn.com
> www.ebay.ca
> www.expedia.ca
> www.zdnet.com
> www.cnn.com
>
> after I executed the client program,
> I got this result each hostaddress.
>
> array[0]=www.yahoo.ca
> "There are 2 users on this system

    Because you are not running the "server" on the remote machines;
    you are running it on your local box. You are trying to pipe the
    output of the telnet command into th estdin of your script ON YOUR
    LOCAL COMPUTER, and the script doesn't read stdin.

    Even if it did, telnet command is not going to produce anything;
    how are you giving it a login name? How are you giving it a
    password?

    What makes you think you can get a telnet connection to a web
    server?

> what was wrong?

    It would be quicker to ask what is right.

    Did you read any of the earlier replies to your posts?

    What part of Barry's reply did you not understand?

    To refresh your memory, here is an abbreviated version of what he
    told you:

> You can't find out how many users are logged into a web site.
> You can't find out how many users are logged into a web site.

    Get it?

-- 
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2003, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License


Relevant Pages

  • Does WMI have to be installed on Remote Computer?
    ... I'm new to WMI, learning as I go. ... does WMI need to be installed on the remote computer in order for a ... script which uses WMI to work? ... ''' First try to ping the server. ...
    (microsoft.public.scripting.vbscript)
  • RE: Does WMI have to be installed on Remote Computer?
    ... IMHO this looks like a well constructed and very vell commented script. ... WMI comes as standard on w2k w2k3 and xp, ... does WMI need to be installed on the remote computer in order for a ... ''' First try to ping the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: Is there a remote control tool which works with firewalls and
    ... > computer and router OK? ... and have the remote computer connect its server to your listening ... even though the remote computer is the server (provides the ... Your local computer is accessed, as if it's a server, by the ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: reboot clients
    ... > I tried on my local computer and the script rebooted my computer. ... > a different remote computer and it didn't work. ... if I want to list multiple ...
    (microsoft.public.windows.server.scripting)
  • Re: Distribute files from the server to client machines
    ... > I don't really understand what the script does. ... > called ComputerInfo on the server. ... > I would like this to be done every time a user logs on. ... local computer, but knowing who he is I suspect he has good reason for this. ...
    (microsoft.public.windows.server.scripting)