How can I create a Finder alias in a bash script that reads arguments from the command-line?
With minimal error handling:

#!/bin/sh

[ -f "$1" ] || exit 1
[ "$2" ] || exit 1

alias=$(basename "$2")

/usr/bin/osascript &lt;&lt;EOF
tell application "Finder"
    set myapp to POSIX file "$1" as alias
    make new alias to myapp at Desktop
    set name of result to "$alias"
end tell
EOF

mv ~/Desktop/"$alias" "$2"