house9

random code and what not

bash scirpt to launch rails development environment

here is a bash script I put together to launch my rails development environment, i got tired of opening multiple terminal windows and cd to the project dir, this script
  • launches script/server in a terminal window
  • launches a new terminal and cd to the trunk
  • launches firefox at http://localhost:3000 with a specific firefox profile
  • and launches Komodo Edit - go ahead and pick the editor of your choice
this works on Ubuntu, probably on other Linux distro’s that use Gnome



I saved this in a file ~/scripts/launch_YOUR_PROJECT.sh
to execute this open a terminal and type ~$ bash ./scripts/launch_YOUR_PROJECT.sh
or create a symlink in your home directory



then execute using ~$ bash launch_YOUR_PROJECT

NOTE: in theory you should not need to even specify bash at the command prompt, when I did not I received the following error ”bash: launch_YOUR_PROJECT: command not found
running ’which bash’ returns ’/bin/bash’ which is specified in the shell script?, something to look into later.