Passing values to shell script

hey guys.

I have a shell script


quote USER $USER
cd GXF
put $FILE

exit 0

That i need to pass two values two. You would do this on the command line like ./ val1 val2

How do i do this in apple script?

One thing.
These are values of stuff in apple script.

set val1 to "whatever"
set val2 to "whatever"

do shell script "/path/to/" & space & val1 & space & val2

Unless the text/data being passed through to a program via do shell script is a constant string literal, it is best to used quoted form of to make sure that nothing untoward happens when the shell gets to interpreting the data. In my opinion, the only reason to not use quoted form of is if the script (or the script’s author) knows about all the potential special shell characters in the string and intends the shell to handle all of them specially. And even then, it is best when the non-special parts of that string are built up from the results of quoted form of.

set val1 to "whatever"
set val2 to "whatever"

do shell script "/path/to/" & space & quoted form of val1 & space & quoted form of val2

If one uses quoted form of too much (quoting something that the shell needs to see non-quoted) the shell script fragment will not work as expected. At the other extreme, if quoted form of is never used, the code will likely have security vulnerabilities.