Sponsored Content
Full Discussion: UNIX CGI script
Top Forums UNIX for Dummies Questions & Answers UNIX CGI script Post 10245 by TioTony on Saturday 10th of November 2001 01:32:24 AM
Old 11-10-2001
I went to the URL and it appears to be working fine. Have you already fixed it?

If not, I think it may be a combo of problems between the lines:

name1=`echo $slice|cut -d+ -f1`
name2=`echo $slice|cut -d+ -f2`
name3=`echo $slice|cut -d+ -f3`
name4=`echo $slice|cut -d+ -f4`
name5=`echo $slice|cut -d+ -f5`
name6=`echo $slice|cut -d+ -f6`

and the $? = "0"

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.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HTML-CGI on Unix

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)
Discussion started by: sstevens
4 Replies

2. Shell Programming and Scripting

CGI passing arrays/hashes to another CGI script

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)
Discussion started by: WIntellect
2 Replies

3. Shell Programming and Scripting

How to share CGI Scripts across UNIX web server?

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)
Discussion started by: karlsworld
1 Replies

4. UNIX for Dummies Questions & Answers

How to share CGI Scripts across UNIX web server?

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)
Discussion started by: karlsworld
5 Replies

5. UNIX Desktop Questions & Answers

CGI execution problem on Unix

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)
Discussion started by: Preeti_t
2 Replies

6. Web Development

cgi script and external UNIX commands (like swadm)

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)
Discussion started by: jofinjoseph
9 Replies

7. Shell Programming and Scripting

Execution problem unix commands in Perl CGI

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)
Discussion started by: Navrattan Bansa
28 Replies

8. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

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)
Discussion started by: Arun_Linux
3 Replies

9. Programming

CGI Perl script to execute bash script- unable to create folder

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)
Discussion started by: rakeshkumar
0 Replies

10. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

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)
Discussion started by: scriptscript
1 Replies
HOBBIT-NKEDIT.CGI(1)					      General Commands Manual					      HOBBIT-NKEDIT.CGI(1)

NAME
hobbit-nkedit.cgi - Xymon Critical Systems view CGI SYNOPSIS
hobbit-nkedit.cgi DESCRIPTION
hobbit-nkedit.cgi is invoked as a CGI script via the hobbit-nkedit.sh CGI wrapper. hobbit-nkedit.cgi is a web-based editor for the hobbit-nkview.cfg(5) file, which is used to configure the Xymon "Critical Systems" view. A detailed description of how to use the editor is provided in the Xymon Web documentation, available from the "Help" -> "Critical Systems" link on the Xymon website. SECURITY
Access to this CGI script should be restricted through access controls in your webserver. Editing the Critical Systems View configuration will impact the monitoring of your site. OPTIONS
--config=FILENAME Name of the Critical Systems View configuration file. The default is hobbit-nkview.cfg in the $BBHOME/etc/ directory. --env=FILENAME Loads the environment defined in FILENAME before executing the CGI script. --area=NAME Load environment variables for a specific area. NB: if used, this option must appear before any --env=FILENAME option. --debug Enables debugging output. SEE ALSO
hobbit-nkview.cgi(1), xymon(7) Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-NKEDIT.CGI(1)
All times are GMT -4. The time now is 01:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy