Skip to content

Repository files navigation

Bashful Shells ๐Ÿš

ScriptsPlatformShellExercises

A collection of automation scripts, productivity hacks, self-made challenge walkthroughs and solutions to interview exercises related to DevOps, Linux System Administration and Developer Tools.


๐Ÿ™‹โ€โ™‚๏ธ What's Over Here?

  • Plenty of Bashful (understandably blushy) shells waiting to be noticed
  • Solutions to interview problems and exercises
  • A petty attempt to promote the fun of shell scripting ๐Ÿคž
  • Generator scripts (that bootstraps the test environment to solve the corresponding problem)
  • A constant reminder to myself that I don't need to reinvent the wheel everytime I rediscover the same issue

๐Ÿ“Œ Note to self: Remember that ugly script you wrote scratching the head for two hours last week? It's never too late push that over here!


๐Ÿ’ผ Pre-requisite

Regardless of the environment you may have, chances are rare that you have to compile bash from source. A bash shell can be accessed through following means:

  • GNU/Linux based Distros (Preinstalled)
  • Git Bash for Windows (for lifeless maniacs)
  • Online Bash Interpreter

๐ŸŽฎ Shell Scripting Exercise Solutions

devops-exercises contains a comprehensive list of exercises to skill-up in DevOps domain. Here's my take on the shell scripting problems.

SerialNameProblem DescriptionSolution
1Hello WorldExerciseSolution
2Basic dateExerciseSolution
3Great DayExerciseSolution
4FactorsExerciseSolution
5Argument CheckExerciseSolution
6Files SizeExerciseSolution
7Count CharsExerciseSolution
8SumExerciseSolution
9Number of ArgumentsExerciseSolution
10Empty FilesExerciseSolution
11Directories ComparisonExerciseSolution
12It's alive!ExerciseSolution

โš’ Usage for Problem Solvers

  • Run the generator.sh script to create a folder hierarchy of all the problems with a ready for you to tackle! Executing the script will:

    1. create a subdirectory for each of the challenges
    2. create a fresh template file script.sh under each of the subdirectories

    โš  Some of my problem directories contain additional init.sh script. Copy that into your corresponding location and run it to generate the test environment for that particular problem

  • As a bonus, you'll find additional scripts in few of my solutions. Those are the bash concepts / topics that I discovered / tried out before implementing them on the corresponding solution.

  • For better understanding, my personal approach to the problems is enclosed in function mysolve(), whereas the intended solution can be found under function actualsolve().


๐ŸŽฎ HackerRank Linux Shell Problems

The Linux Shell module by HackerRank has some interesting text processing problems regarding commands like awk, cut, grep, head, sort, tr, uniq, paste, sed etc.

SerialNameProblem DescriptionSolution
1Middle of a Text FileExerciseSolution
2Looping and SkippingExerciseSolution
3Compute the AverageExerciseSolution
4Slice an ArrayExerciseSolution
5Filter an Array with PatternsExerciseSolution
6Display Nth wordExerciseSolution
7Dlt a set of charsExerciseSolution

๐Ÿ™ Acknowledgements

A portion of the scripts are based on the problems from various online sources. The originality and copyright of those problem descriptions and corresponding sample data are created by the respective authors and platform owners.

This collection highlights contents from following modules:

About

Blushy shell ๐Ÿš scripts for DevOps folks & Sysadmins

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Contributors

Languages