Code Monkey home page Code Monkey logo

introduction-to-bash-scripting's Introduction

πŸ’‘ Introduction to Bash Scripting

This is an open-source introduction to Bash scripting guide/ebook that will help you learn the basics of Bash scripting and start writing awesome Bash scripts that will help you automate your daily SysOps, DevOps, and Dev tasks. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you can use Bash scripts to combine different Linux commands and automate boring and repetitive daily tasks, so that you can focus on more productive and fun things.

The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Bash scripting.

πŸš€ Download

To download a copy of the ebook use one of the following links:

πŸ“˜ Chapters

The first 13 chapters would be purely focused on getting some solid Bash scripting foundations then the rest of the chapters would give you some real life examples and scripts.

🌟 Sponsors

This book is made possible thanks to these fantastic companies!

πŸ“Š Materialize

The Streaming Database for Real-time Analytics.

Materialize is a reactive database that delivers incremental view updates. Materialize helps developers easily build with streaming data using standard SQL.

πŸ’™ DigitalOcean

DigitalOcean is a cloud services platform delivering the simplicity developers love and businesses trust to run production applications at scale.

It provides highly available, secure, and scalable compute, storage, and networking solutions that help developers build great software faster.

Founded in 2012 with offices in New York and Cambridge, MA, DigitalOcean offers transparent and affordable pricing, an elegant user interface, and one of the largest libraries of open source resources available.

For more information, please visit https://www.digitalocean.com or follow @digitalocean on Twitter.

If you are new to DigitalOcean, you can get a free $100 credit and spin up your own servers via this referral link here:

Free $100 Credit For DigitalOcean

πŸ‘©β€πŸ’» DevDojo

The DevDojo is a resource to learn all things web development and web design. Learn on your lunch break or wake up and enjoy a cup of coffee with us to learn something new.

Join this developer community, and we can all learn together, build together, and grow together.

Join DevDojo

For more information, please visit https://www.devdojo.com or follow @thedevdojo on Twitter.

πŸ•ΈοΈ Web Page

A web page showcasing the eBook:

Introduction to Bash Scripting Web Page

The web page was built using Tails, a new kick-ass drag-and-drop TailwindCSS page builder!

DigitalOcean App Platform

The website is hosted on the DigitalOcean App Platform.

We utilize the "Deploy to DigitalOcean" Button to deploy to the App Platform:

Deploy to DO

πŸ“Ή Mini Video Course

If you prefer watching videos rather than reading, you can find a quick crash course based on the first 12 chapters of the eBook here:

Introduction to Bash Scripting Mini Video Crash Course

πŸ’» Interactive training

You can follow the interactive training online here:

Introduction to Bash Scripting Interactive training

The training was built with Katacoda. You can find the Katacoda repository here.

For more information on how to use Katacoda make sure to follow the steps from this tutorial here:

How to Use Katacoda to Create Highly Engaging Training Tutorials

πŸ‘‹ About the author

My name is Bobby Iliev, and I have been working as a Linux DevOps Engineer since 2014. I am an avid Linux lover and supporter of the open-source movement philosophy. I am always doing that which I cannot do in order that I may learn how to do it, and I believe in sharing knowledge.

I think it's essential always to keep professional and surround yourself with good people, work hard, and be nice to everyone. You have to perform at a consistently higher level than others. That's the mark of a true professional.

For more information, please visit my blog at https://bobbyiliev.com, follow me on Twitter @bobbyiliev_ and YouTube.

In case that you want to support me you can By Me a Coffee here:

Buy Me A Coffee

πŸ”₯ PDF Generation Tool

The project uses Ibis developed by Mohamed Said.

Ibis is a PHP tool that helps you write eBooks in markdown.

🎨 Book Cover

The cover for this ebook was created with Canva.com.

If you ever need to create a graphic, poster, invitation, logo, presentation – or anything that looks good β€” give Canva a go.

πŸ”— Links

πŸ“– Other eBooks

🀲 Contributing

If you are contributing 🍿 please read the contributing file before submitting your pull requests.

introduction-to-bash-scripting's People

Contributors

aemtox avatar arunabh-gupta avatar badshahyadav avatar blackeyeb avatar bo-iliev avatar bobbyiliev avatar brianpinto91 avatar ek234 avatar ezerw avatar georgievalex avatar imkelp avatar justijndepover avatar karmatashicat avatar killinefficiency avatar kotbenek avatar kshitijdwivedi28 avatar kubeden avatar marcelozarate avatar mustafaamer-1 avatar nirzak avatar peterdavehello avatar rdxr10 avatar rgrangeiro avatar sayansahu99 avatar shmick avatar siwar9 avatar spekulatius avatar timgoldbach avatar williamaboucaya avatar yinjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

introduction-to-bash-scripting's Issues

Feature: slice of $@ in Arguments

Hi,

First thanks for book, I have been using it recently and I find it pretty handy.

The second, I think it would be useful to add some example explaining how to access to a slice of $@, in the section "Arguments" .
Something like the solution found here.

Thanks!

Feature: Proxy automation script!

Yes, my shell script is an automation script for system-wide proxy setup on linux installed machines.

I have been wandering why we at our college are not able to access the internet from within the terminal when behind a proxy server. Henceforth we had to switch between personal wifi and the college proxy every now and then.

I'd like this issue be solved by writing a few simple command from the terminal to toggle the proxy on and off.

The current way of tackling this problem is to manually comment out all the config files for whom one sets the proxy. I would like this to be automated with as minimum efforts as possible.

I HAVE THE SOLUTION DONE MYSELF!
A month ago I wrote this shell script which does the above job by just a couple commands.
To turn the proxy on enter the commands:
myproxy on
source /etc/profile.d/proxy.sh

To turn off:
myproxy off
source /etc/profile.d/unset_proxy.sh

You can check the script here

PLEASE ASSIGN ME THIS FEATURE!
I SUPPOSE THIS WILL ADD VALUE TO THE BOOK AND MIGHT SERVE A REAL LIFE PURPOSE FOR LEARNERS!

THANK YOUπŸ˜‡

Help: Bad array subscript

Please fill out this template

Error accessing last element from an array

Additional context

I'm having problem when accessing the last item from an array. I followed exactly the same as written in the book. Can someone explain me if I did something wrong? Thanks.

My script:

#!/bin/bash

my_array=("value 1" "value 2" "value 3" "value 4")

# Access item 1
echo ${my_array[1]}

# Access the last item
echo ${my_array[-1]}

# Access all the items
echo ${my_array[@]}

# Output total number of elements in the array
echo ${#my_array[@]}

Shell output:

value 2
script1.sh: line 9: my_array: bad array subscript

value 1 value 2 value 3 value 4
4

Hindi-Translation of the Book

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Additional context

Bug: Typo on page 46

Typo in opening paragraph:
The difference between until and while loops is that the until lool will run the commands within the loop until the condition becomes true.

Change lool to loop.

Help: a variable list filtering via sed + "blacklist-variable"

dirlist=$(ls /home) =>

dirlist="blackcrack akira lost&found workshop garage office"
blacklist="lost&found garage workshop"

the way to the result
echo $result
blackcrack akira office

how become from the $dirlist i a filtering with the 3 words in the $blacklist
to a result with the rest of the words..

i have try it via oneliner :

[blackcrack@blackysgate ~/bearbeit-net]$ dirlist=$(ls /home) ; blacklist="lost&found garage workshop" ; echo $dirlist | sed 's/$blacklist//'
blackcrack akira lost&found workshop garage office
[blackcrack@blackysgate ~/bearbeit-net]$

but it works not really simply with sed.. mus i use there a loop or something over "while"

best

Feature:

Is your feature request related to a problem? Please describe.

You have not added the links to the chapters in the README.MD file

Describe the solution you'd like

I can add all the links to the content in your README.MD

Additional context

please assign me this issue for hacktoberfest 2021

Feature: CSV to VCF

Hey hi Siddhesh is here..
I made bash script which convert CSV file into VCF format.
Please give me chance to contribute, if you think this will add value to your repository.
Thank you ...

Feature:

page 49 in the Loops lesson, the main code is

#!/bin/bash

read -p "What is your name? " name

while [[ -z ${name} ]]
do
    echo "Your name can not be blank. Please enter a valid name!"
    read -p "Enter your name again? " name
done

echo "Hi there ${name}"

could be shortened to :

#!/bin/bash

read -p 'what is ur name ? ' name

if [[ -z ${name} ]]
then
        echo 'please insert some name ...'
        $0
else
        echo hello, $name
fi

and THX ❀

Feature: Make epub to better experience

Is your feature request related to a problem? Please describe.

Hi, firstly thanks for this book. It's awesome work but in PDF is dificult to read in cellphone while go to work.

Describe the solution you'd like

I finded a tool called pandoc that make epub file from md files. More info here:
https://pandoc.org/epub.html

Additional context

I think pandoc will help to build books by language when people start to translate them.

Feature: Add a guide to vagrant for practicing linux in varius distributions.

Is your feature request related to a problem? Please describe.

I am requesting for a feature.

Describe the solution you'd like

I have been using vagrant for practicing linux. I think it is a great tool for practicing linux with various distributions and without actually installing Linux OS. You just download an vagrant-box and do 'vagrant up' , it is ready. So, I think it is great for linux practicing.

Additional context

Bug: 008 bash Array.md

Describe the bug

I was reading the book to revise my concepts , while revising i have noted that 008-bash array file has bug in .md file

my_array=("1""2""3""4""5")
echo ${#my_array[@]} --this will print only the first value not  the total no. of elements

Explainig Syntax error with screenshot
image

Correct Way of Writing πŸ‘

echo ${#my_array}  --this will print the number of elements in my array 

Attached Screenshot (for sake of proof)

image

please assign this to me , i will fix accordingly ...

Thanks you ❀️

Add Favicon to the website

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Additional context

Feature: heredoc and herestrings

Would you like to include heredoc and herestrings in the redirection section?

I believe that this would be very helpful for bash scripters.

"Substring in Bash :: Slicing" - in wrong place?

Page 27 and 28 feel a bit out of place. The section is called "Substring in Bash :: Slicing", but all the examples talk about arrays which aren't introduced until page 29. It might make more sense if the examples were changed to be based on normal strings rather than arrays, or swap the sections?

Feature: avoid this in Alias

I faced a problem while making aliases i hope this note would help

(Note : deal with ~/.bashrc or ~/.zshrc according to the shell u use )

make sure first what shell do use the command below will let u know :

echo "$SHELL"

why do you have to know ..? because editing the ~/.bashrc while u use zsh and even resourcing or logging out will give no benefit since u configure a file for shell ur not currently using
commands :
if u use zsh ~> nano /.zshrc
if u use bash ~> nano /.bashrc and so on ..

Feature: Translating in diffrent languages

Is your feature request related to a problem? Please describe.

not any understand very easy englisch

Describe the solution you'd like

for better understanding translating in different languages

Additional context

  • nothing

[Request] Open Discussions Forum

could we have here a Discussions Forum, to ask different questions around bash and scripts ?
For have the users a Platform here where can ask short for loop, arrays or others in bash.. how ever..
my wanted help do i now set as issue ;)

best

Feature: Include version number

Is your feature request related to a problem? Please describe.

I downloaded your book some time in the past. However, I don’t know when. I have no idea which release of your book I downloaded. If I want to download a new version, I can’t compare it to the version I currently have because there is nowhere in the book that has a version number.

Describe the solution you'd like

Easy β€”Β include a version number in your text. Also, a copyright or copyleft notice, or a clear statement of license, would be nice as well.

Thanks for a great book!

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.