We introduce our organization of custom bash scripts for development.
Bash is essential for automating tasks in Ubuntu. Generally, you'll work with three kinds of
- Distribution scripts—these come with your Linux distribution
- Deployed scripts—these come with deb packages that you install
- Personal scripts—these are fully under your control and live in your home folder
You'll need a folder where you store your personal
bash scripts. As with any code, this should be placed under source control.
Please see our short guide on source control and ensure your environment is set up appropriately.
Personal Bash Repository
In the interest of consistency, let's choose
mysh as the project name for personal scripts. Create your project on your BitBucket account. Then check out your new project into
Now modify your
$HOME/.bashrc to include this folder on your
You'll need to reload your
.bashrc for this to take effect. You can just open a new terminal.
Let's create a sample program
hello.sh to test our configuration.
#!/usr/bin/env bash echo "hello"
This should be in your
mysh folder. Make this script executable
chmod +x hello.sh
Let's change folders to our home.
This should execute your program.
Eclipse Setup for Bash
ShellEd is a good plugin for Eclipse for editing
bash scripts. However it can be tricky to install. We assume Eclipse Indigo Service release 1.
ShellEd requires Linux Man Tools.
Add Update Site
Help -> Install New Software... ->
Linux Tools http://download.eclipse.org/technology/linuxtools/update
Install the Linux Man Tools. Then install