Skip to content

Instantly share code, notes, and snippets.

@dcorking
Created November 24, 2012 15:50
Show Gist options
  • Save dcorking/4140234 to your computer and use it in GitHub Desktop.
Save dcorking/4140234 to your computer and use it in GitHub Desktop.
Launch some handy cheat sheets and other console windows for Rails development
#!/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/
@dcorking
Copy link
Author

dcorking commented Jun 3, 2013

This is too complicated. The -T option is not needed if your xterm is configured to set its title to the running program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment