Giter VIP home page Giter VIP logo

bash-template's Introduction

bash-template

GitHub last commit (branch) GitHub issues GitHub

A simple starting place for new Bash scripts. This script:

  • Uses /usr/bin/env bash for portability.
  • Uses the unofficial Bash Strict Mode.
  • Checks that bash 4 is executing the script.

Usage

Option 1: clone this repository as a template

The easiest way to get started is by clicking the green Use this template button, then selecting Create a new repository. You will then be guided through creating a new repository in your account that uses the files in this repository as a template!

Option 2: Visual Studio Code snippet

Open the user snippets file called "shellscript.json" and add the following:

"Bash Strict Mode Starter": {
  "prefix": "starter",
  "body": ["#!/usr/bin/env bash","#","# Short description goes here. Maximum 3 sentences. If possible, keep each line","# under 80 characters for easy readability.","","","init() {","  set -euo pipefail # strict mode","  #set -x            # uncomment when debugging your script","  IFS=$'\\n\\t'       # IFS restricted to newline and tab","}","","","main() {","  init # run init function","  echo success","}","","","# make sure bash 4 is being used and run the script, exit otherwise","# this prevents people from running the script with an unsupported interpreter","if [ -z \"${BASH_VERSINFO}\" ] || [ -z \"${BASH_VERSINFO[0]}\" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]","then","  echo \"This script requires Bash version 4 or newer.\"","  exit 1","else","  main","fi"],
  "description": "A starter script for a Bash shell script."
}

Issues

The issues tracker contains both issues and feature requests. There are templates available if you're not sure how to submit your issue.

Issues for Newcomers

Occasionally, I will mark simple issues with the good first issue label so that newcomers to git can learn the ropes. If you're new, please check these out to get your hands dirty!

If you have absolutely no experience to the git workflow, or you need a refresher, check out this site made by rogerdudler!

Contributing

  1. Fork this repository
  2. Add your change
  3. Create a pull request

Note: I am testing GitKraken's GitFlow feature with this repository. You are NOT required to follow this style of contribution.

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.