[librecat-dev] Catmandu::Fix removes paths from variables

Patrick Hochstenbach Patrick.Hochstenbach at UGent.be
Wed Jun 20 17:24:00 CEST 2018


Thank we'll work on that documentation. The short answer is that it is safe to quote every string (single or double have currently the same effect). We often don't quote string more for shorthand reason (if it looks like a string, it is a string). 

The dangerous strings that should always be quotes, no matter what, are those containing the characters ":" "," "=" and ">"

Patrick

> On 20 Jun 2018, at 15:15, Mayr-Duffner, Georg <georg.mayr-duffner at wu.ac.at> wrote:
> 
> Hi Johann and Patrick,
> 
> 
> 
> Thank you very much for your answers. This solution is indeed simple and logical. And it directly leads me to a follow up question:
> 
> While studying the documentation I nowhere found a hint on which strings in a fix file should be quoted, single quoted or double quoted an which not. First, I tested some variations which all worked fine (I didn't test variables back then) and then decided to misuse quoting to highlight certain values in the entries.
> 
> 
> 
> I think, it would be great if that was mentioned somewhere as the documentation shows different usage all over the place and also the mails you two wrote show differences in this regards.
> 
> 
> 
> Best regards
> 
> Georg
> 
> 
> 
> Am 20.06.18, 11:31 schrieb "Patrick Hochstenbach" <Patrick.Hochstenbach at UGent.be>:
> 
> 
> 
>    Hi Georg
> 
> 
> 
>    There is most probably an error in your Fix script:
> 
> 
> 
>    This:
> 
> 
> 
>    marc_set('999a',W:\Users\gduffner\Docs\Documents\Alma\UBL\data\iso3166H2marc.csv)
> 
> 
> 
>    is not a valid syntax. The double colon “:” has a special meaning in the Fix syntax. When you want to use it in a string value you need to use single/double quotes around your string:
> 
> 
> 
>    marc_set('999a’,'W:\Users\gduffner\Docs\Documents\Alma\UBL\data\iso3166H2marc.csv’)
> 
> 
> 
>    or, when this path is in a variable write something as:
> 
> 
> 
>    marc_set(‘999a’,’{{MY_PATH}}’)
> 
> 
> 
>    Cheers
> 
>    Patrick
> 
> 
> 
>>> On 20 Jun 2018, at 11:11, Mayr-Duffner, Georg <georg.mayr-duffner at wu.ac.at> wrote:
>> 
>> 
> 
>> W:\Users\gduffner\Docs\Documents\Alma\UBL\data\iso3166H2marc.csv
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> librecat-dev mailing list
> - send list mails to librecat-dev at lists.uni-bielefeld.de
> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
> - project website: http://librecat.org/



More information about the librecat-dev mailing list