Created
November 24, 2012 15:50
-
-
Save dcorking/4140234 to your computer and use it in GitHub Desktop.
Launch some handy cheat sheets and other console windows for Rails development
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 | |
# Launch some handy cheat sheets and other console windows for Rails development | |
# in unix-like systems | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
# To the extent possible under law, dcorking has waived all copyright | |
# and related or neighbouring rights to rgo.sh. This work is published | |
# from: United Kingdom. | |
launch-console() { | |
xterm -T "$@" -e "$@" & | |
} | |
commands=("top" "cheat git" "cheat capybara" "cheat rspec" "cheat cucumber") | |
for comm in "${commands[@]}" ; do # I am not sure how the parameter | |
# expression works - see below | |
launch-console "$comm" # quotes are needed here to pass the | |
# arg in the right format | |
done | |
# With some valuable help from Charles Duffy's answer at | |
# http://stackoverflow.com/questions/301039/how-can-i-escape-white-space-in-a-bash-loop-list | |
# more on the "${list_array[@]}" construction at | |
# http://www.linuxquestions.org/questions/programming-9/bash-passing-arrays-with-spaces-611159/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is too complicated. The -T option is not needed if your xterm is configured to set its title to the running program.