Passing values to shell script

hey guys.

I have a shell script


#!/bin/bash
FILE=$1
SUBDIR=$2
HOST='10.1.1.70'
USER='yourid'
PASSWD='yourpw'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
binary
cd GXF
cd $SUBDIR
put $FILE
quit
END_SCRIPT

exit 0

That i need to pass two values two. You would do this on the command line like ./shell.sh 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/shell.sh" & 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/shell.sh" & 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.