473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Error in perl script.

hello,

i have write a script for finding user.my code is look like following.

Expand|Select|Wrap|Line Numbers
  1. #!/usr/local/bin/perl
  2. #
  3. # check whether user is logged on
  4. #
  5.  
  6. if ($#ARGV != 0) {
  7.     print "usage: finduser username\n";
  8.     exit;
  9. }
  10.  
  11. $username = $ARGV[0];
  12. $machines = "insanity ".`systems sgi`;
  13. chop($machines);
  14. @machines = split(/ /,$machines);
  15. @machines = sort(@machines);
  16.  
  17. foreach $machine (@machines) {
  18.  
  19.     if(`rusers $machine | grep $username`) {
  20.     print "$username logged on $machine\n";
  21.     }
  22. }

when i trying to run this script i get 2 errors.the errors are follows.
'systems' is not recognized as an internal or external command,operable program or batch file.
'rusers' is not recognized as an internal or external command,operable program or batch file.

please help me.
Aug 3 '10 #1
5 1789
Oralloy
985 Expert 512MB
At the risk of sounding flip, I'm pretty sure it means exactly what it says - it can't find your commands "systems" or "rusers".

Can you execute these commands at the command line by yourself? If not, then you will need to adjust your path.

If you can, then there is some disconnect between your path, and the one that the executor under your script uses.
Aug 3 '10 #2
chaarmann
785 Expert 512MB
Test whether these two programs "systems" and "rusers" are in the actual path on the unix shell by typing "which systems" (or "whence systems") and "which rusers" (or "whence rusers"). If not, try to find them with "find" and add their path to environment variable PATH. Before running your perl script, type "export PATH".
Aug 3 '10 #3
thanks for reply.

i m very new in perl script. i m running this script in windows. and i run both command in command prompt but can't find anything working.

can i set appropriate path in windows. and according to that should i change something in my code ?
Aug 4 '10 #4
chaarmann
785 Expert 512MB
There is no command "systems" or "rusers" on windows. I also searched my cygwin installation, it's not there!
I know that "rusers" is a linux command which tells who is logged in to machines on local network.

So you need to research if these commands exist for windows and you can download them, then install them and set your windows environment variable "PATH" to them via "My Computer -> properties -> extension tab".
Or maybe you can rewrite your script and use some other commands that are doing the same and are available in windows.
Aug 4 '10 #5
okay, i'll try to search for same.

thanks.. chaarmann, for help !!!
Aug 4 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: FLOTServer | last post by:
Here's my problem: I run a gameserver that runs the game "Medal of Honor". On the game server is log file which contains all of the data from the players for that day (kills, deaths, etc...). I...
3
by: PzYon | last post by:
Hey 2gether! I'm trying to execute a PERL script on the web server when the user presses a button in an ASP.NET Web Application using Visual Basic. The most obvious solution for me seemed to be...
4
by: benwylie | last post by:
I am running IIS 6.0 on Windows 2003. I would like to be able to run a perl script from a web page and include the output. I have tried doing it with an ssi: <form action='docsearch.shtml'...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
1
by: Balajisanthanakrishnan | last post by:
Old Title: Hi all, need help for this perl script- thanks in advance I am BalajiSanthanakrishnan, chennai. Now I am working in a Perl Script which is executing in the Unix Servers. Basically i am...
2
by: kimonp | last post by:
I am running on windows XP with a fresh install of wamp5 (1.7.2) and mediawiki. I am trying to call a perl function from within php using proc_open. The perl script is being executed and...
3
by: tundal45 | last post by:
Hey Guys, I am trying to automate the process of loading data in our oracle server. As a part of that process, I am working on a perl script that loads external tables from data files. What I am...
4
by: vijayarl | last post by:
Hi All, i have the following software installed in my system : 1.OS: Win2k 2.Eclipse Version used :3.4.0 & even the perl too... 1. I have imported the my own perl project in Eclipse, when i...
3
by: vijayarl | last post by:
Hi all, i have perl script, which is used to send mail. its a command line utility. if we run this perl script in command line by passing all it's required arguments, it works very well.there no...
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.