Do shell command - AppleScript

Hi all
I’m calling the perl program in apple script using Do shell command.

do shell script "cd" & " " & prgpath & " " & "perl sample.pl" & " " & inputpath

In prgpath, the perl program path is stored.

In inputpath, the input file path is stored.

when i run the script, i’m not getting the output. It does not show any error also. It returned with the “”.

What is happening in my script? Where am i going wrong?

-jacintha

Hi jacintha,

it could have several reasons:
¢ multiple commands in a shell lines must be separated with semicolons
¢ paths including space characters must be quoted or the spaces must be escaped

I would prefer this form (prgpath must end with a slash)

do shell script "perl " & quoted form of (prgpath & "sample.pl") & " " & quoted form of inputpath