Using parameters with Shell

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Using parameters with Shell

Post by exheusden » Sun Dec 05, 2010 8:42 pm

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?

glpunzi
Posts: 57
Joined: Sun Nov 28, 2010 5:50 pm
Contact:

Re: Using parameters with Shell

Post by glpunzi » Sun Dec 05, 2010 8:59 pm

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?

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Re: Using parameters with Shell

Post by exheusden » Sun Dec 05, 2010 9:21 pm

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.)

Post Reply