Page 1 of 1

Using parameters with Shell

Posted: Sun Dec 05, 2010 8:42 pm
by exheusden
Here's a shell command that runs nicely in RunRev and LiveCode:

get shell ("zip -q0X BodySnatchers.epub mimetype")

But I want to use it with a variable filename: BodySnatchers.epub might be ShrinkingMan.epub one day, or RootsOfElvis.epub on a different occasion, or any other name, depending on the text I am "epubbing".

Is it possible to somehow execute the shell command with a variable that contains the name of the file?

Re: Using parameters with Shell

Posted: Sun Dec 05, 2010 8:59 pm
by glpunzi

Code: Select all


put "BodySnatchers.epub" in theEpub

get shell ("zip -q0X " & theEpub & " mimetype")

I don't know if ithis is correct, or if works, I'm here only a few days evaluating LiveCode :P

P.D.: Guardamanr del Segura? eres español?

Re: Using parameters with Shell

Posted: Sun Dec 05, 2010 9:21 pm
by exheusden
Hola Giuseppe,

Thanks for the pointer in the right direction. I have used something similar and this works:

put eBookepubFileName & ".epub" into epubFileName
put "zip -q0X" && epubFileName && "mimetype" into shellCode
get shell (shellCode)

Edit: CORRECTION! This doesn't work!!! I assumed it did, as no error was returned, but I have now discovered that it fails quietly.

(No soy español, pero tengo residencia aquí en España. Soy oriundo de Gales, pero he vivido más en otros paises, como Inglaterra y Belgica.)