I don't think that's it.

I think the issue here is that gethttp runs curl, and on OSX, the &
character is a command separator (similar to ; or newline, except that
it also specifies that the command to its left is run in the
background).

So, fetching 
https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose%E2%80%99
using gethttp returns the result of executing at the osx command line

search=dyadic%20transpose%E2%80%99

This produces an empty result (and sets the environmental variable
'search' to the value 'dyadic%20transpose%E2%80%99', but that is
immediately discarded when the subshell exits).

In other words, I think gethttp needs to quote the url for use in a
shell command before calling curl.

In other words, any " or $ or \ characters in the url need to be
prefixed with a \ (probably using rplc) and then the resulting string
needs a leading " and a trailing " character.

Linux should get the same treatment.

Thanks,

--
Raul


On Sat, Apr 22, 2023 at 11:55 AM Norman Drinkwater
<[email protected]> wrote:
>
> On macos, gethttp uses curl. To retrieve multiple urls, I believe you need
> to specify a target file to receive each result.
> https://everything.curl.dev/usingcurl/downloads/multiple
>
>
> On Sat, Apr 22, 2023 at 9:27 AM Ed Gottsman <[email protected]>
> wrote:
>
> > Hello.  I’ve been working with gethttp (on the Mac) and have noticed
> > something odd.  I’ve boiled it down to
> >
> >    ('-o ' , jpath '~temp/gethttp.html') gethttp '
> > https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose
> > '
> >
> > …works.  It creates a file in ~temp containing the html.  Though,
> > strangely, it seems to do it asynchronously—the call returns before the
> > file is created and you have to poll for it thereafter.
> >
> > However,
> >
> >    $ gethttp '
> > https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose’
> > <
> > https://code.jsoftware.com/mediawiki/index.php?title=Special:Search&limit=70&offset=0&profile=default&search=dyadic%20transpose%E2%80%99
> > >
> > 0
> >
> > …immediately returns no bytes.  (I imagine they’re eventually going to a
> > default file somewhere but have not tried to track it down.)
> >
> > I’ve experimented and it seems as if specifying more than one header
> > parameter (or more than two if you specify one with -H and one with &) will
> > cause this behavior.
> >
> > Am I misguided (or hallucinating)?  If not, is there a way to help gethttp
> > take multiple headers and still return the html directly and
> > synchronously?  (I’d prefer to avoid polling for files.)
> >
> > Thanks very much.
> >
> > Ed
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to