Variable followed by single quote?

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
x942
Posts: 5
Joined: Wed Aug 14, 2013 4:47 am

Variable followed by single quote?

Post by x942 » Thu Aug 15, 2013 6:41 am

I am trying to create an app the calls adb.exe and runs a special command but I am having issues here:

Code: Select all

 "adb shell su -c 'vdc cryptfs pde wipe" && decoyVariable && HiddenVariable & ' 
This doesn't work because of the last single quote. How do I get that quote added to the end of the line after both variables? That single quote is needed adb shell tries to execute each word after -c as a separative command. In C# I would do

Code: Select all

 var encrypt = Proccess.Start("cmd","adb shell su -c 'vdc cryptfs pde wipe" +decoyVariable + HiddenVariable + "'") 


where the last single quote is enclosed in double quotes. is that the same in LiveCode? Would I encase it in double quotes?

Many thanks,

x942
Last edited by x942 on Thu Aug 15, 2013 7:44 pm, edited 1 time in total.

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Variable followed by single quote?

Post by dave_probertGA6e24 » Thu Aug 15, 2013 7:53 am

Yes, or you can use the constant: Quote

Code: Select all

  adb shell su -c 'vdc cryptfs pde wipe" && decoyVariable && HiddenVariable & "'"
or
  adb shell su -c 'vdc cryptfs pde wipe" && decoyVariable && HiddenVariable & QUOTE
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Variable followed by single quote?

Post by Simon » Thu Aug 15, 2013 8:12 am

Maybe I can learn something here:
...wipe"...
What does a single double quote do?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

x942
Posts: 5
Joined: Wed Aug 14, 2013 4:47 am

Re: Variable followed by single quote?

Post by x942 » Thu Aug 15, 2013 7:45 pm

Simon wrote:Maybe I can learn something here:
...wipe"...
What does a single double quote do?

Simon
Typo There is also a double quote in the front.

Thanks for the answer! Everything works.

x942
Posts: 5
Joined: Wed Aug 14, 2013 4:47 am

Re: Variable followed by single quote?

Post by x942 » Thu Aug 15, 2013 7:51 pm

dave_probertGA6e24 wrote:Yes, or you can use the constant: Quote

Code: Select all

  adb shell su -c 'vdc cryptfs pde wipe" && decoyVariable && HiddenVariable & "'"
or
  adb shell su -c 'vdc cryptfs pde wipe" && decoyVariable && HiddenVariable & QUOTE
Dave
Perfect. I think I had used QUOTE with double & so it didn't work. It works now though :)

Post Reply