Skip to content

Instantly share code, notes, and snippets.

@jalogut
Created November 8, 2018 15:45
Show Gist options
  • Save jalogut/14da745bd01619fb9e3d5b2432b8ac36 to your computer and use it in GitHub Desktop.
Save jalogut/14da745bd01619fb9e3d5b2432b8ac36 to your computer and use it in GitHub Desktop.
Execute bash command in a new window of iterm2
#!/bin/bash
#set -x
COMMAND=$@
osascript -e 'tell application "iTerm2"' \
-e 'create window with default profile command "bash -c \"echo " & "'"${COMMAND}"'" & " && " & "'"${COMMAND}"'" & " && read || read \""' \
-e 'end tell'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment