Benoît Minisini ha scritto:
>> Hi List,
>>
>> I want to end up with this text to pass to the shell, and it contains
>> quotation marks, I wondered how to do that.
>>
>> wkhtmltopdf *.html /tmp/temp.pdf --toc --header-right "Page [page]"
>>  --footer- center "- EasyGP Medical Records -" --footer-spacing 5
>>  --footer-font-name "comic sans ms"
>>
>> any help appreciated.
>>
>> Regards
>>
>> Richard
>>
>>     
>
> In Gambas 3, you can use the Shell$() function to quote arguments sent to a 
> shell.
>
> And in your example, you should better use Exec instead of Shell to run the 
> command.
>
> Regards,
>
>   
Agreed for using EXEC instead of SHELL. (but he wants to expand *.html).

Anyway, you can use tickmarks (single quotes) instead of double quotes 
in your command line.
If the text enclosed by single quotes does not need to be expanded by 
the shell, then single quotes are good if not better. Don't put 
asterisks inside single quotes, unless you really mean "*" and not "all 
files".
Your command line could be:

    EXEC "wkhtmltopdf *.html /tmp/temp.pdf --toc --header-right 'Page 
[page]' ... ..."
    ' see "Page [page]" surrounded by ticks

Ciao,
Doriano


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to