How do I do this: -$: sample.sh <INPUT>

I apologize for the confusing title .. What I want to do is write a script that pulls specific input from the command line (after the script name) rather than from within the script.

Example:

-$: howfarbetween.sh Montreal Chicago

Where the script would run based on the inputs of the two city names.

Thanks for all help in advance!

J

Not only the title, your explanation too.

Are you looking for this ?

if [ "$1" = "Montreal" -a "$2" = "Chicago" ]
then
    echo 'X Km';
else
    echo 'Y Km';
fi

Command-line arguments are stored in the positional parameters, $1, $2, etc..

Thank you so much!

That is exactly what I was looking for!