Code Monkey home page Code Monkey logo

bash_u's Introduction

Bash University - Basic Programming in Bash

With so many people just getting started in Linux, I thought it'd be a good idea to give them a place to learn Bash programming.

The basic curriculum is

  1. Variables
  2. Assignments and Basic Operators
  3. The shell environment
  4. if/then and && and ||
  5. Functions
  6. Parameters/arguments
  7. Return status
  8. Arrays
  9. Loops
  10. String Operations
  11. Number Operations
  12. Bash Special Variables
  13. File Testing
  14. Command/Process Substitution
  15. Pipelines, more on STDIN/STDOUT/STDERR
  16. Regular Expressions
  17. Commonly Used Externals (sed,awk,grep,sort,bc,etc)
  18. Testing with Bats

The trouble with teaching these things is that everything gets intertwined. What do you teach first? The chicken or the egg? My feeling is that it doesn't matter. You're going to have to revisit the thing at some point. It's an ongoing process to keep learning programming concepts. There's no way to present the entire gammut in one entirely-perfect-for-everyone way. You start some place and keep going, learning what you need as you need it. That's how I've approached this course.

Real World Problems

I think the most useful approach is to use real world problems. Do some sort of project that actually solves a problem or does a task that you can use. In the beginning, this will be hard, so we'll have to stick to simple problems for a long time. Eventually, we'll get to progress to more interesting projects. But that's how it is with any programming language. You start with very simple projects and progress as far as you want to go.

Here are some examples:

  1. create a function that adds two numbers together
  2. create a function that multiplies two numbers together
  3. create a function that echos 'even' or 'odd' based on a given number
  4. create a function that finds a shell script named waldo and replaces a note at the top saying "I've been found"
  5. create a fizzbuzz script
  6. solve some classic beginner programming problems
  7. introduce exercism.io and the bash track

bash_u's People

Contributors

deepbsd avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.