[REBOL] Strange problem with --cgi

2000-01-18 Thread jbone


I can't seem to get cgi-bin stuff working properly, and the problem seems
sort of strange.  I'm using the latest Rebol on a late (2.2 kernel) Red Hat
Linux.  I have a file (test-cgi.r) which has the magic incantation on the
first line:

#! /usr/local/bin/rebol --cgi -s

followed by the script in question.  The script file is owned by the web
server user (nobody) and executable by owner.  Whenever the web server
(Apache, late version) invokes the script, the script spits out the
initialization text (Finger protocol loaded /n Whois protocol loaded etc.)
followed by command usage text, then invokes the script.  I thought --cgi
suppressed that?

Further mystery:  when I invoke the script directly by hand (i.e.,
./test-cgi.r) from the shell, the same thing happens, and the script ends at
the Rebol REPL prompt without exiting the interpreter.  OTOH, when I invoke
it by hand from the shell indirectly (i.e., rebol --cgi -s ./test-cgi.r) the
initialization text etc. is suppressed and the script exits as expected.

I'm sure this is brain-dead stupid, but any thoughts?

jb




[REBOL] Strange problem with --cgi Re:

2000-01-18 Thread sterling


Do
#!/usr/local/bin/rebol -cs
instead.

That should solve your problem.

Sterling

 I can't seem to get cgi-bin stuff working properly, and the problem seems
 sort of strange.  I'm using the latest Rebol on a late (2.2 kernel) Red Hat
 Linux.  I have a file (test-cgi.r) which has the magic incantation on the
 first line:
 
 #! /usr/local/bin/rebol --cgi -s



[REBOL] Strange problem with --cgi Re:(2)

2000-01-18 Thread jbone


Nope, same symptoms.  --cgi and -c are synonyms, no?  When I change the first
line to #!/usr/local/bin/rebol -cs, I get the same behavior as with blah --cgi
-s, namely:  Rebol initialization strings print, and the interpreter does not
exit when the script is finished.

jb

[EMAIL PROTECTED] wrote:

 Do
 #!/usr/local/bin/rebol -cs
 instead.

 That should solve your problem.

 Sterling

  I can't seem to get cgi-bin stuff working properly, and the problem seems
  sort of strange.  I'm using the latest Rebol on a late (2.2 kernel) Red Hat
  Linux.  I have a file (test-cgi.r) which has the magic incantation on the
  first line:
 
  #! /usr/local/bin/rebol --cgi -s



[REBOL] Strange problem with --cgi Re:(3)

2000-01-18 Thread sterling


You sure your webserver is set up properly?
What're you using anyway?

Sterling

 Nope, same symptoms.  --cgi and -c are synonyms, no?  When I change the first
 line to #!/usr/local/bin/rebol -cs, I get the same behavior as with blah --cgi
 -s, namely:  Rebol initialization strings print, and the interpreter does not
 exit when the script is finished.
 
 jb
 
 [EMAIL PROTECTED] wrote:
 
  Do
  #!/usr/local/bin/rebol -cs
  instead.
 
  That should solve your problem.
 
  Sterling
 
   I can't seem to get cgi-bin stuff working properly, and the problem seems
   sort of strange.  I'm using the latest Rebol on a late (2.2 kernel) Red Hat
   Linux.  I have a file (test-cgi.r) which has the magic incantation on the
   first line:
  
   #! /usr/local/bin/rebol --cgi -s
 
 



[REBOL] Strange problem with --cgi Re:(4)

2000-01-18 Thread jbone



[EMAIL PROTECTED] wrote:

 You sure your webserver is set up properly?
 What're you using anyway?

Pretty sure, and Apache.  Here's why I think my web server is set up properly:  when I
run the script *by hand* by doing ./test-cgi.r, I get the same apparently erroneous
behavior as when the web server invokes the script.  The first line (
#!/usr/local/bin/rebol -cs ) should invoke Rebol with -cs and feed it the rest of the
file as script to interpret.  This *should* suppress the initialization strings, and
exit the script when complete if I understand -c / --cgi correctly.  The behavior is
the same --- and wrong --- when Apache invokes the script and when I invoke it by
hand.  I get the *correct* behavior when I run rebol -cs test-cgi.r from the shell.
This leads me to believe that for some reason rebol isn't getting its arguments ( -cs
) when invoked via "shell magic" #!/foo/rebol args.

Thoughts?

jb



 Sterling

  Nope, same symptoms.  --cgi and -c are synonyms, no?  When I change the first
  line to #!/usr/local/bin/rebol -cs, I get the same behavior as with blah --cgi
  -s, namely:  Rebol initialization strings print, and the interpreter does not
  exit when the script is finished.
 
  jb
 
  [EMAIL PROTECTED] wrote:
 
   Do
   #!/usr/local/bin/rebol -cs
   instead.
  
   That should solve your problem.
  
   Sterling
  
I can't seem to get cgi-bin stuff working properly, and the problem seems
sort of strange.  I'm using the latest Rebol on a late (2.2 kernel) Red Hat
Linux.  I have a file (test-cgi.r) which has the magic incantation on the
first line:
   
#! /usr/local/bin/rebol --cgi -s
 
 



[REBOL] Strange problem with --cgi Re:

2000-01-18 Thread icimjs

My guess is you're using Apache. Try

#! /usr/local/bin/rebol --cs

(or was it 
#! /usr/local/bin/rebol -cs

?)



;- Elan  [: - )]



[REBOL] Strange problem with --cgi Re:(2)

2000-01-18 Thread jbone


Nope, that's not it.  I'm already using the second form, which should be
correct.  The key to understanding this problem is this:  the problem
occurs whether it's invoked by Apache or directly;  i.e., it's not an
Apache problem.  Ignore the fact that the script is intended to be run
from a web server;  I've verified that Apache is doing the right thing
in invocation.  Take a look at the following

foo11 ls -aglF
 ...snip ...
-rwxr-xr-x1nobodynobody3850Jan 18 22:24
test-cgi.r*

If I run the script from the shell by invoking it directly, I obtain the
following

foo12 ./test-cgi.r
Finger protocol loaded
Whois protocol loaded
...
script output


(note that the last prompt in that is the Rebol REPL prompt, not the
shell prompt) whereas if I invoke the interpreter, passing the args and
script name, I get the expected results

foo13 /usr/local/bin/rebol -cs ./test-cgi.r
script output
foo14

So it seems as though the Rebol interpreter isn't seeing the -cs
argument on the shell magic line when it gets invoked directly, as in
the first case.  This behavior is consistent across all "by the book"
formulations of that argument list, namely "--cgi -s" and "-cs."  I.e.,
the first line of the file "test-cgi.r" in the above examples is

#!/usr/local/bin/rebol -cs

...which should be correct according to the documentation, if I
understand it correctly.  Note too that other shell scripts which take
arguments to their interpreters on the first line of the file, for
instance debugging flags and such, work properly in my environment.  I
find it really suspicious that nobody else has run into a similar
problem;  this leads me to suspect something in the interface between
Rebol and my environment.  Anyone else running similar versions of Rebol
and Linux?

Aside:  any Rebol script file I run that starts with
"#!/usr/local/bin/rebol" with no arguments causes the interpreter to
simply startup and be initialized and the script itself is ignored.
Tres bizarre.

jb


[EMAIL PROTECTED] wrote:

 My guess is you're using Apache. Try

 #! /usr/local/bin/rebol --cs

 (or was it
 #! /usr/local/bin/rebol -cs

 ?)

 ;- Elan  [: - )]



[REBOL] Strange problem with --cgi Re:(3)

2000-01-18 Thread bobr

At 11:01 PM 1/18/00 -0600, [EMAIL PROTECTED] wrote:
 Note too that other shell scripts which take
arguments to their interpreters on the first line of the file, for
instance debugging flags and such, work properly in my environment.  I
find it really suspicious that nobody else has run into a similar
problem;  this leads me to suspect something in the interface between
Rebol and my environment.  Anyone else running similar versions of Rebol
and Linux?



boston:/rebolorg/wiki# cat reb
#!/usr/bin/rebol -cs
REBOL [Title: "-cs tester"]
print "hello,rebol"


boston:/rebolorg/wiki# ./reb
hello,rebol


boston:/rebolorg/wiki#


{-}
[EMAIL PROTECTED]