I have to set up a bash script which will be in the autorun for all our users.
I can not set the terminal settings to close on "process complete". I can not 'KillAll' the terminals.
Does someone know an approach? I think the PID-solution (not parent pid) would be a nice way.
OS used is MacOS Sierra.
test.sh
#!bin/bash currentUser=$(whoami) mkdir -p ~/Desktop/Pdrive mount_smbfs //server/UserData/$currentUser ~/Desktop/Pdrive #pid=$$ #kill $pid #exit 0 #kill -15 $$ #disown #kill -9 $(ps -p $(ps -p $PPID -o ppid=) -o ppid=) #osascript -e 'tell application "Terminal.app" to quit' #pkill -f test.sh exit
osascript -e 'tell application "Terminal" to close first window'#to ask you before leavingosascript -e 'tell application "Terminal" to close first window' & exit#leave without asking. P.S Please do not use killall because killall does different things on different Unix versions.