Solved

Pity on me 4 a repost...

Posted on 1997-04-16
3
174 Views
Last Modified: 2013-12-25
I'm going to spend some points to re-ask this question, which teaches me a lesson:  Don't grade a question without testing the answer *thoroughly* first.

Having said that, here's the question (which I've asked here before) again.  I'm running a CGI script that I can't get to work.  This is the script:

#!/bin/sh
PATH=$PATH:/usr/bin#

# ^ the above line was added as a result of the last question...

echo "Content-type: text/html"
echo
echo "<HTML><HEAD>"
echo "<TITLE>Is Laura There?</TITLE>"
echo"</HEAD><BODY>"

ison='who | grep lemay'

if [ ! -z "$ison" ]; then
      echo "Laura is logged in"
else
      echo "Laura isn't logged in"
fi

echo "</BODY></HTML>"

OK, this script was entered into Notepad on an NT box, and then FTP'd to a UNIX server.  The HTML page is more or less a simple anchor reference to the script.  When I run the script, I get the following error:

/web/beta/cgi-bin/pinglaura.cgi: echo: not found

We're running a Sun server, that should understand UNIX, right? ;)  Our server software is Netscape's Fasttrack Server.  What language is this script written in?  Is it just straight UNIX (as opposed to PERL)?  

I should note that the UNIX server logs off the user if you type "exec pinglaura.cgi."
 
I should ALSO note that sometimes the file comes up as "not found," even though surfing the file directory shows it's there.  I have to repost it before the web browser can even see it.  I've checked both the permissions AND the CGI set up.

I see what julio (the pro that answered the question the last time) was getting at when he told me to add the PATH line, but it didn't work, for some reason.  Do I have to set the directory some other way?

Should the first "ison" be a scalar: "$ison?"  (Although I've tried that, and it doesn't seem to work much better that way.)

Thanks, pros...

Raydot.
0
Comment
Question by:Raydot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Author Comment

by:Raydot
ID: 1827913
Wow, I've been all over this script in the past 24 hours, and nothing seems to work.  So here's an addendum to the original question, what language is this script written in?
0
 
LVL 3

Author Comment

by:Raydot
ID: 1827914
Edited text of question
0
 
LVL 2

Accepted Solution

by:
n3mtr earned 70 total points
ID: 1827915
The script was written in sh.  The original unix command line processor.  Your system may not have sh installed.(a sh script is sort of like a batch file for dos)  Sh has been replaced by other programs, but most systems have it for compatability.
Another possiblility is that your script is in the wrong direcory or has the wrong extention.  Some servers require CGI scripts to be in a certain direcory or have a certain extention.
Yet another possibility is that the text is in dos format.  be sure to upload your file as a text file in your ftp software.  This will convert it for you.
Another possibility is that the case is wrong.  Unix servers are case sensitive.  I have had this problem many times, because win95 is not case sensitive.
Last possibility is a programming error, but I'm not a sh expert.
But the programming looks sound to me.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Recursively Delete Files 5 103
Logon script fails 23 61
AWK - Blank file output zero bytes why? 18 34
Help with Progress 4gl Rounding Function 6 28
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
This article will show, step by step, how to integrate R code into a R Sweave document
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question