Last active
August 29, 2015 14:06
-
-
Save yousefamar/26f2128dadbd20340db2 to your computer and use it in GitHub Desktop.
Runs a command multiple times in new terminals with different arguments
This file contains 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
#!/usr/bin/sh | |
# | |
# Runs a command multiple times in new terminals with different arguments | |
# | |
# Authors: | |
# Yousef Amar <[email protected]> | |
# | |
if [ $# -lt 1 ]; then | |
echo "syntax: spawn.sh COMMAND [ARGS...]" | |
exit | |
fi | |
TERMINAL="evilvte" | |
if [ $# -lt 2 ]; then | |
$TERMINAL -e "$1" & | |
exit | |
fi | |
for args in "${@:2}" | |
do | |
$TERMINAL -e "$1" "$args" & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes:
alias sp='spawn.sh '
in your shell's rc filealias vv='spawn.sh vim'
will vim each file argument in a new terminalvv scripts/*.py
sp ping "-c 10 google.com" "-v facebook.com" youtube.com