Sorry for misguiding you, I was sure i entered backslashes not slashes!
I guess i didn’t see what keys I hit on the keyboard \ is the one to try, like a normal escape in the shell,
but you need one more, since AppleScript uses the [b][/b] as a special character.
I guess it was the bold quoting that made the trick (or not)
The question becomes how do you enter that in applescript. In applescript the \ character is the escape character, so you have to put that in front of any double-quote character because your command text is between double-quotes in applescript. You have another problem though. You actually want to pass the \ character through to the command line as well. Applescript won’t pass that character through because it’s the escape character. So in essence you have to escape the escape character to pass it through.
Here’s how I would write it. You’ll see that I placed a \ character in front of all the " and \ characters in your original command.
set cmd to "blocknum=`printf %d \"'\\ bs=1 skip=2 count=1 2>/dev/null\\`\"`"
do shell script cmd
I think you should be aware of the different ways you actually can execute strings of commands from the shell.
That knowledge might ease what you are trying to achieve.
the semicolon is a command separator, like if you had entered return in the shell. I you want to consolidate the output of several shell commands into one result from the do shell script command, then you can do that by
surrounding the whole sequence with parenthesis like this:
[code]# Try this in the terminal window with some small reall files:
( echo “file one”;cat file.one ;echo “file two” ; cat file.two ) |more
everything should be returned in the result of the “do shell script”[/code]
What you specifically wants:
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set theText to (do shell script "cd / ; ls ")
set theText to theText as text
set AppleScript's text item delimiters to astid
--display dialog theText