我正在尝试运行一个 shell 脚本,然后自行关闭,但不完全退出终端。以下是我所拥有的:
#!/bin/sh
while [ "$JOB_NUMBER" = '' ]; do
echo -n "++++++++++++++++++++Job Number: "
read -e JOB_NUMBER
done
echo "Opening Job Number: $JOB_NUMBER's folder"
open -g /Volumes/OSX_0*/$JOB_NUMBER*
sleep .5
osascript -e 'tell application "Terminal" to quit' & exit
但这里的 AppleScript 退出了终端,而我只是想关闭那个窗口