Passer la variable du script shell au script

J'ai un script shell que j'appelle qui utilise osascriptet que osascript appelle un script shell qui passe dans une variable que j'ai mis dans l'original script shell. Je ne sais pas comment faire pour passer cette variable à partir de l'applescript de script shell.

Comment puis-je passer une variable du shell script applescript pour shell script...?

Laissez-moi savoir si je ne fais pas de sens.

 i=0
 for line in $(system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'); do
 UDID=${line}
 echo $UDID
 #i=$(($i+1))
 sleep 1


 osascript -e 'tell application "Terminal" to activate' \
 -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' \
 -e 'tell application "Terminal" to do script "cd '$current_dir'" in selected tab of the front window' \
 -e 'tell application "Terminal" to do script "./script.sh ip_address '${#UDID}' &" in selected tab of the front window'

 done

source d'informationauteur KKendall