How to do shell script with speech marks in it

How do I tell applescript to “do shell script” if the script has speech marks in it? Applescript ends the shell script as soon as it runs into the next speech mark, so I don’t get my script run.

for example

do shell script "echo "walrus""

errors because it ends prematurely.

This is probably very simple, but doesn’t seem particularly obvious to me.

Thanks

" is called a double-quote. There are at least three ways:

do shell script "echo 'walrus'" -- use single quotes

do shell script "echo \"walrus\"" -- escape the quotes (and any spaces) with backslashes

do shell script "echo " & quoted form of "walrus" -- let applescript do it

ah, thank you. The third way looks easiest.

It’s the simplest too because it will deal with all the characters that need escaping, most notibly a space in a file name.