Hey everyone!
I hope someone here is good with Unix CGI scripts.
I'm having trouble with my CGI. Here's the deal
I've created a program that searches the passwd file and cuts the users real name when it's given the login name. When i converted it to CGI i ran into some problems:
1) when you put one login name in, it echo's a statement (user is online/offine) 6 times! BUT when you put 2 or more, there is no repeating.
2) i dont think $* works when doing for loop. i had to hard code up to 6 variables (could be more though)
can anyone offer any help? I also ported this into an HTML version, but still have the same problems. (could have swore i had this working, but when i saved the HTML one, i over wrote the working one, and i forgot what changed i made )
I think it's my quotes but i'm not really sure anymore lol
If you insert "set -x" just before your loop (or anywhere after the Content-type) you will get lots of debugging info about what is going on. That may help you find the problem.
I think if you are doing a cut -f6 but you did not feed it a 6th name, name6 will be set to nothing. When you do a who | grep > /dev/null, this may return 0 on some systems because it runs but does not produce output. I tried on Sun and actually got a return code of 2 plus a STDERR about the correct usage of grep. You could simply add a test to the loop that checks to see if $name != "". If it doesn't, then process the username, otherwise just exit because you know if name3 is blank, name4,5, and 6 are aswell.
Oh yea, i got it working eventually. Had to code in an if statement.
Having a little trouble with the HTML version, but I'm gonna try and work through it. if not... I'll be back for anyones help!
thanks people
primal
Hi team,
I have a typical problem with cgi pages in apache webserver in WINDOWS
I am able to execute(display) the pages that are saved in cgi-bin folder.
But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder.
Could anyone please let me know how... (1 Reply)
Hi
I have a bash script which takes parameters
sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC
gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash
I have... (0 Replies)
Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect.
Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is
redirected to welcome page.
My... (3 Replies)
I am trying to run SSH , mkdir and other unix commands using Perl CGI. But i am not able to Execute these commands.
Please help me out !!!!
SSH and mkdir is necessity for me.
I will be thankful to you...!!!!!
I am trying like:
In perl CGI file i am writing like: @list = `ssh... (28 Replies)
Hi,
I am trying to implement a server monitoring dashboard using cgi scripting. I am planning to run the necessary unix scripts from the web page using cgi. This method works fine for standard unix commands but I am unable to run some external unix commands (like swadm show_processes, swadm... (9 Replies)
Hello everyone,
I have developed a cgi application on windows. i have created a folder in webapps of tomcat, within that a WEB-INF folder and in that cgi folder.
This cgi folder contains one executable. The web.xml is as follows: <servlet>
<servlet-name>cgi</servlet-name>
... (2 Replies)
Hi, is it possible to create a CGI folder somewhere on the server and allow all domains on that server be able to access the scripts? I tried a ScriptAlias addition in httpd.conf but still no luck. Would greatly appreciate any tips! Thanks.
Linux version 2.4.20-021stab028.3.777-enterprise
Plesk... (5 Replies)
Hi, is it possible to create a CGI folder somewhere on the server and allow all domains on that server be able to access the scripts? I tried a ScriptAlias addition in httpd.conf but still no luck. Would greatly appreciate any tips! Thanks.
Linux version 2.4.20-021stab028.3.777-enterprise
Plesk... (1 Reply)
If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link?
Hope that makes sense!
:) (2 Replies)
AAAHHH!! I've made a perl program that you can run on a web browser. This program needs to be run everyday, and I don't want to have to run it everyday. The problem is when I try running the program from my terminal, all it does is print stuff to the terminal page (the program involves a lot of... (4 Replies)