Discussion:
[hercules-390] Problem in sending command via HCMD
antonio acortel@costaisa.com [hercules-390]
2018-09-21 10:44:02 UTC
Permalink
Hello,
I'm using David B.Trout's HCMD utility,
and some command launches do not work correctly.


Specifically in my case the command "sf+ *" does not work correctly,
on the contrary the command "sf- *" is correct.
The result of the executions is the following:

C:\Users\ccn\Documents\HERCULES_390\hercules 4\HCMD de FISH>hcmd 1 sf+ *

HHC01603I sf *
HHC01600E Unknown command sf, enter 'help' for a list of valid commands


C:\Users\ccn\Documents\HERCULES_390\hercules 4\HCMD de FISH>hcmd 1 sf- *

HHC01603I sf- *


C:\Users\ccn\Documents\HERCULES_390\hercules 4\HCMD de FISH>



Any idea about this problem will be welcome.
Thank to all.


my versions:

HHC01603I version
HHC01413I Hercules version 4.00.0.8204-g2acd8b8
HHC01414I (c) Copyright 1999-2013 by Roger Bowler, Jan Jaeger, and others
HHC01415I Built on May 31 2015 at 08:59:54
HHC01416I Build information:
HHC01417I Windows MSVC AMD64 host architecture build
HHC01417I Modes: S/370 ESA/390 z/Arch
HHC01417I Max CPU Engines: 32
HHC01417I Using Fish threads Threading Model
HHC01417I Using Error-Checking Mutex Locking Model
HHC01417I With Syncio support
HHC01417I With Shared Devices support
HHC01417I With Dynamic loading support
HHC01417I Using shared libraries
HHC01417I With External GUI support
HHC01417I With Partial TCP keepalive support
HHC01417I With IPV6 support
HHC01417I With HTTP Server support
HHC01417I With sqrtl support
HHC01417I Without SIGABEND handler
HHC01417I With CCKD BZIP2 support
HHC01417I With HET BZIP2 support
HHC01417I With ZLIB support
HHC01417I With Regular Expressions support
HHC01417I With Object REXX support
HHC01417I Without Regina REXX support
HHC01417I With Automatic Operator support
HHC01417I Without National Language Support
HHC01417I Machine dependent assists: cmpxchg1 cmpxchg4 cmpxchg8
HHC01417I Running on: PC0N26DQ (Windows-6.2.9200 Intel(R) x64) LP=8,
Cores=4, CPUs=1

HHC01603I http
HHC01809I HTTP server is waiting for requests
HHC01811I HTTP server root directory
'C:/Users/ccn/Documents/HERCULES_390/hercules 4/html/'
HHC01808I HTTP server port is 80 with noauth
herc =====>



--
Sent from: http://hercules390.996247.n3.nabble.com/Hercules390-General-f3.html
'\'Fish\' (David B. Trout)' david.b.trout@gmail.com [hercules-390]
2018-09-21 21:31:02 UTC
Permalink
Post by antonio ***@costaisa.com [hercules-390]
Hello,
I'm using David B.Trout's HCMD utility,
and some command launches do not work correctly.
[...]
Post by antonio ***@costaisa.com [hercules-390]
C:\Users\ccn\...\HCMD de FISH> hcmd 1 sf+ *
HHC01603I sf *
HHC01600E Unknown command sf, enter 'help' for a
list of valid commands
Hi Antonio!

This appears to be a day-one bug in Hercules's http server logic that is purposely translating all '+' (plus sign) to ' ' (blank). Why it is doing that I do not know. It doesn't make any sense.

I have already committed the fix for this bug and it will appear in the next Windows pre-built snapshot (which hopefully will be "soon").

Until then, the only workaround I have found (which is admittedly ugly), is as follows:

1. When you start Hercules, issue a "defsym" command to define a Hercules symbol for any command(s) you need to issue that have a '+' plus sign in them, e.g.:

defsym sf_add "sf+"


2. Use the defined Hercules symbol in your HCMD command:

hcmd 1 $(sf_add) *


I hope that helps!

Thank you for reporting this bug!
--
"Fish" (David B. Trout)
Software Development Laboratories
http://www.softdevlabs.com
mail: ***@softdevlabs.com
Martin Truebner Martin@pi-sysprog.de [hercules-390]
2018-09-22 06:23:04 UTC
Permalink
Fish,
.... that is purposely translating all '+' (plus sign) to '
' (blank). Why it is doing that I do not know. It doesn't make any
sense.
I am old enough to help here.

When CICS learned to answer HTTP the first bridge-programs (that took
the stream coming in) required + where 3270 had blanks.

I do recall sending links like this:

www.nyc.gov/whatever/some_more/CICS/DFH$WEBA/CEMT+PERF+SHUT+I

to people (and some did what I expected them to do- click the link)

Maybe the person preparing the Hercules's http server logic had some
CICS background.

Martin
dwegscheid@sbcglobal.net [hercules-390]
2018-09-23 14:33:30 UTC
Permalink
It's not early CICS specific; spaces in URLs can be represented as plus signs or in "percent hex" format (%20. I think some (or many) webservers will now accept the spaces instead. Ref:


https://tools.ietf.org/html/rfc3986 https://tools.ietf.org/html/rfc3986


https://en.wikipedia.org/wiki/Percent-encoding https://en.wikipedia.org/wiki/Percent-encoding



If you want a plus sign in a URL, it's %2B.


I wonder what "sf%2B" does.
'\'Fish\' (David B. Trout)' david.b.trout@gmail.com [hercules-390]
2018-09-23 20:45:16 UTC
Permalink
Post by ***@sbcglobal.net [hercules-390]
It's not early CICS specific; spaces in URLs can be
represented as plus signs or in "percent hex" format
(%20. I think some (or many) webservers will now accept
https://tools.ietf.org/html/rfc3986
https://en.wikipedia.org/wiki/Percent-encoding
If you want a plus sign in a URL, it's %2B.
Hmmm... You may be right. Thanks!

Let me do some more digging...
--
"Fish" (David B. Trout)
Software Development Laboratories
http://www.softdevlabs.com
mail: ***@softdevlabs.com
dwegscheid@sbcglobal.net [hercules-390]
2018-09-23 15:26:44 UTC
Permalink
Fish, you may want to hold off on the commit. '+' signs in URLs *should* be changed into spaces.....
'\'Fish\' (David B. Trout)' david.b.trout@gmail.com [hercules-390]
2018-09-23 20:52:02 UTC
Permalink
Post by ***@sbcglobal.net [hercules-390]
Fish, you may want to hold off on the commit.
'+' signs in URLs *should* be changed into spaces.....
I believe you are right. I have reverted my commit.

It now appears the bug may actually be in my HCMD scripts (either the 'hcmd..cmd' script (which parses and then passes the command to the 'hcmd.vbs' vbscript) and/or the 'hcmd.vbs' vbscript itself (which sends the command to Hercules and retrieves the results)).

I'm working on it!
--
"Fish" (David B. Trout)
Software Development Laboratories
http://www.softdevlabs.com
mail: ***@softdevlabs.com
'\'Fish\' (David B. Trout)' david.b.trout@gmail.com [hercules-390]
2018-09-24 01:57:59 UTC
Permalink
(CC: antonio)

Fish wrote:

[...]
Post by '\'Fish\' (David B. Trout)' ***@gmail.com [hercules-390]
I'm working on it!
Done!

New version 1.2 of my 'hcmd' package uploaded to my FTP server:

ftp://www.softdevlabs.com
ftp://www.softdevlabs.com/networking/hcmd


Plus signs, double quotes, spaces, etc, are now all preserved exactly as-is (as entered on the command line).

Please be sure to also read the accompanying README.txt file ("hcmd /?" help output) which explains the need to "escape" certain special characters ('&' ampersand, '<' less than and '>' greater than).

Thanks.
--
"Fish" (David B. Trout)
Software Development Laboratories
http://www.softdevlabs.com
mail: ***@softdevlabs.com
antonio acortel@costaisa.com [hercules-390]
2018-09-25 07:22:07 UTC
Permalink
Thank you Fish the new version already works perfectly.
Greetings to all.



--
Sent from: http://hercules390.996247.n3.nabble.com/Hercules390-General-f3.html
Peter Coghlan mailinglists@beyondthepale.ie [hercules-390]
2018-09-23 21:46:53 UTC
Permalink
Post by '\'Fish\' (David B. Trout)' ***@gmail.com [hercules-390]
Post by ***@sbcglobal.net [hercules-390]
Fish, you may want to hold off on the commit.
'+' signs in URLs *should* be changed into spaces.....
I believe you are right. I have reverted my commit.
It now appears the bug may actually be in my HCMD scripts (either the 'hcmd.cmd' script (which parses and then passes the command to the 'hcmd.vbs' vbscript) and/or the 'hcmd.vbs' vbscript itself (which sends the command to Hercules and retrieves the results)).
I'm working on it!
There might (or might not) be some inspiration in some similar code I wrote:

http://software.beyondthepale.ie/hercules/sendhercules/

Regards,
Peter Coghlan
Loading...