Write Your Own Bash Scripts for Automation [Tutorial]

  • 🎬 Video
  • ℹ️ Description

Make Custom Bash Scripts to Automate Linux Tasks

Cyber Weapons Lab, Episode 209

Bash is a simple scripting language that's useful for chaining together various Linux tools without requiring you to learn any programming. In this episode of Cyber Weapons Lab, we'll use aliasing to call programs and then use Bash to automate tasks.

Follow Null Byte on:

💬 Comments

This is my kind of guy. His eyes tell me he's wasted no more than 3 hours sleeping since birth.

Author — Zephyrus


I love your videos, can't thank you enough for what you do out here, and thanks for taking the time to "give us" this knowledge. Keep. Up the good work!

Author — Dru Zod


This guy explains it better than my professor did last week

Author — jonyboi21


You didn’t need the `echo $(`…`)` at the end, you just needed to escape the `$` so it doesn’t get expanded in the string: `alias ipaddress="ifconfig | grep broadcast | awk '{print \$2}'"`.

Author — Sebastian Simon


Great video. Exactly what a bash nab (me) needs to start up, see how to make a basic one then build on it, then add more and more and bit of polish ... brilliant.

Author — P


Writing bash scripts has saved me thousands of hours over the years. Thank you for the video, this is incredibly useful.

Author — Alex


thanks from France!! I can't wait for the next video about bash scripting ! :)

Author — cosmic link


Learning how to automate task with code seriously turns you into a damned sorcerer. Changed my life for sure. Like an old professor once told me,

"you have an army of a million robots waiting for your command"

Author — Blaize Guerra


well now that im on an NSA watch list i can safely say i can automate things in a bash script

Author — Some Guy


Good habits put in a "header" with the date, your name and purpose of the script.
Also keep upper case vars for env vars.
^^^ being kind to your future self

Author — p campbell-edu


"Kody"? Jackie is the punk. Thanks for shooting and sharing such a great tutorial.

Author — BurningtunaDC


Awesome presentation! Thanks for the clarification.

Author — A. G.


Even though it's quite a simple quide, it's great!
Thank you!

Author — CleanSlate


Writing scripts with nano? Really? Not that I want to start an editor war, but newcomers have the right to learn the beauty of vi, vim and it's derivatives. It takes 5 minutes to learn vi (and some time to master it). Best regards 👍

Author — Ildefonso Girón


Cool video- There is a lot of content like this on youtube but your style makes this easy to ingest for beginners. Couple if things though- You don't have to have .sh at the end of it and it you're going to run it with `bash <scriptname>` you don't need the shebang either. Also, why did you have to fuzz the ifconfig command?
I hope you continue this series- bash offers some much more advanced capabilities.

Author — Dennis Ruzeski


I was wondering about python scripting? Like is it similar and can it be used as an alternative to bash scripting? I know you can do bash commands in python and I've used bash; I've also created a dockerfile and was wondering if creating a python script file would be similar to bash scripting? Thanks for any replys.

Author — K D


Me thinking about something*

One day later this dude who never blinks says: “hmm maybe i should make a video about that”

Author — Benjamin Dreyer


You guys are reading my mind! This is EXACTLY the video I was looking for. This video is gold. More like this.

Author — Cody Gaudet


Thank you for showing the error you ran into and the work arounds in the video.

Author — Ramgopal Varma


Actually to find out the shell you are currently using you need to execute which $SHELL since most of the time you want your current shell to interpret your script

Author — Aarav Prasad