Created
September 27, 2016 04:33
-
-
Save hex2010/5dff6e0af07b601706ea5250f50c0a74 to your computer and use it in GitHub Desktop.
Run command in new window of iTerm2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -r -d '' script <<'EOF' | |
on run argv | |
tell application "iTerm" | |
activate | |
set newWindow to (create window with default profile) | |
tell current session of newWindow | |
set args to "" | |
repeat with arg in argv | |
set args to args & arg & " " | |
end repeat | |
write text args | |
end tell | |
end tell | |
end run | |
EOF | |
echo "$script" | osascript ``-'' $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
iterm.sh "cd /usr && ls"