#!/bin/bash
# 20170801 JvW Run command in another MAC Terminal
trun_cmd='trun_cmd'
# make it cd back to where we are now
echo "cd `pwd`" >$trun_cmd
# make the title bar reflect the action
echo 'echo -n -e "\033]0;DFSee external command being executed\007"' >>$trun_cmd
echo clear >>$trun_cmd
# the shell command to execute
echo $* >>$trun_cmd
echo rm -f $trun_cmd >>$trun_cmd
chmod +x $trun_cmd
# open it in Terminal to run it in a new Terminal window
open -b com.apple.terminal $trun_cmd
