Unable to refresh
RS
richard22j at zoho.com
Fri Mar 23 05:48:18 PDT 2018
On 22/03/18 23:40, Ralph Corderoy wrote:
> Hi Richard,
>
>>>> If you are typing `get_player .* --since 70' into a Linux shell
>>>> then it will glob the `.*' and replace it with the expansion, e.g.
>>>> `. ..', unless it's quoted.
>>
>> The 3.09 release notes say, "get_iplayer no longer lists all
>> programmes when invoked without a search argument. If you wish to list
>> all programmes, you must now explicitly specify a wildcard search:
>> get_iplayer ".*" - note the quotes.
>>
>> "note the quotes" is in bold, but in this case it seems to give the
>> same results without.
>
> The instructions here say to add two and two, in bold, but I find
> multiplying them works just as well, and raising one to the power of the
> other. :-)
>
> «.*» glob'd by the shell to «.» and «..», and perhaps other things, then
> gives get_iplayer two or more regexps and it tries to match any of them.
> It's not your intent. Convention is to use the strongest quotes
> possible to ease the interpretation by the readers. For regexps, that's
> single quotes, so «get_iplayer '.*'». But «get_iplayer ^» will give the
> same results and needs no quotes.
>
Hi Ralph
It can be easy to over-complicate problems. I am as guilty of that as
anyone.
The primary symptom was that when I refreshed the cache I was told 0
programmes had been added. I was aware that the algorithm for scraping
the schedules had been described as fragile.
When I made my original post I was hoping someone else would try it to
confirm whether there was general problem, or one that only affected me.
If I had looked at the forum I would have seen that had already been done.
My use of --since was by way of confirmation. As it happened I
mis-remembered the command and was too lazy to check the documentation.
Even so I found that with a --since argument less than 60, no programmes
were found, and with an argument over 70, programmes were found. That
was consistent with the dates in some news programmes found which were 3
days earlier.
I got exactly the same results when I inserted the missing quotes. Why
I got the same results is beyond my level of knowledge. If I had
remembered that the search string was a regex I agree I could have used ^
I have come across this in relation to bash
"The characters *, ? and [ are called glob characters or wild card
characters. If an unquoted argument contains one or more glob
characters, the shell processes the argument for file name generation.
The glob characters are part of glob patterns which represent file and
directory names. These patterns are similar to regular expressions, but
differ in syntax, since they are intended to match file names and words
(not arbitrary strings). The special constructions that may appear in
glob patterns are: ... "
What that seems to mean is that without quotes around *. a file name or
word can be matched by bash and with quotes an arbitrary string can be
matched as a regex. It is not clear to me why that matters. One thing
that does not appear to have happened is infinite recursion, or even
matching of additional programmes.
As for using a single quote ' as the strongest quote, I suspect the
documentation has used double quotes " for compatibility with Windows.
Best wishes
Richard
More information about the get_iplayer
mailing list