100 interesting shell scripting problems

Hi all,

I'm just learning to write shell scripts (new to the whole UNIX thing) and I'm wondering if anyone would like to help me create a resource to help me, and others like me, learn scripting. It would be something like "100 interesting shell scripting problems".

[LEFT]All I need are suggestions for interesting problems to solve using shell scripting.
[/LEFT]

My motivation / reasoning is this: I've been learning for a while, but as I'm doing it for pleasure (not for work), I don't really need to write a lot of shell scripts. I've already written a few simple scripts to automate some of my daily tasks, but I want to take my scripting to the next level.

I've got a lot of great books, tutorials, web pages, etc. to help me learn, but they are mostly used for reference, as the examples they include are rather general / trivial, and they don't have many exercises.

Basically, I have a lack of "interesting problems to solve" and therefore a lack of real learning opportunities and practice. I know that others have the same problem too.

So, I'm looking to create a list of practical, interesting, real-world problems which gradually increase in difficulty. It will be similar to thekarangoel's git repo "Projects" where you can learn Python by solving the problems given (sorry, can't post links yet).

As an example, in case I'm not making myself clear, there could be a list of categories, such as:

  • Account Admin
  • Backup
  • Games
  • Networking
  • File manipulation
  • etc.

Each category would contain a number of problems to solve. Some (rubbish) examples might be:

  • Create a script which counts the number of users currently logged in.
  • Create a script which backs up all the dotfiles for the current user.
  • Create a script which converts all file names to lowercase and removes whitespaces.
  • Create a script which converts Markdown formatted text into HTML files.

It will be a kind of learn-by-doing system. The learner will be responsible for finding the information and resources necessary to solve the problem, and may upload his solution for others to study. The problems could include difficulty ratings, hints / tips, suggestions or links to solutions or helpful resources to aid the learner, if need be.

I would make the resource available online as a webpage, wiki, git repo, ebook, or whatever else people want.

As I said, I'm happy to do the heavy lifting myself, but lack of knowledge / experience stops me from creating meaningful problems, or even decent categories of problems / tasks.

Any feedback, help or suggestions would be very much appreciated, but as stated at the beginning all I need to get started are suggestions for interesting problems to solve using shell scripting.

Thank you,

Nickednamed

I trust you realise that all common problems and associated solutions have been posted at some site or another. I would seem a superfluous task to list the same problems again. The vast majority of issues can be readily solved by typing a few key words in a search engine and the answer is usually embedded in the top 10 results.
If you are still unwavered, then you may want to know that next to this site, the site stackoverflow.com frequently comes up in search results. You could copy examples from these sites, but it would still defeat the purpose though.

I think this is interesting, and would be willing to participate if it was about shell scripting. If you look at Reddit - Dive into anything and take their model but limit it to bash / linux I think that would be interesting.

Yes, I do realise that. You can trust me :slight_smile:

But I'm not interested in simply searching the internet for common solutions to common problems. I want a collection of interesting problems chosen for their pedagogical value. I want to use them to learn shell scripting, not just copy and paste some useful scripts.

As you stated, that would defeat the whole purpose of the operation.

Where I need help is finding the right problems. I'm not experienced enough to solve most problems (yet) and therefore I can't judge the educational value, difficulty, or even feasibility of a given problem/solution pair.

---------- Post updated at 06:50 AM ---------- Previous update was at 03:47 AM ----------

Thanks! That link is great!

That is more or less what I was looking for, but as you say, strictly shell script related. As noted above, I don't think I'm in much of a position to set challenges like those listed on the link you provided, but I'll study it and see what I can come up with.

Specifically I don't think I'll know when a task can even be done with shell scripting, or how difficult it will be.

But I was thinking about pretty much the same kind of system:
Scenario + Expected Input + Expected Output

This way the success of a given solution can be measured.

Perhaps for now I will use "the daily programmer" and try to do what I can. But if anyone knows of, or is willing to help create a shell-script-specific resource, similar to the one linked to above, I'm all ears.

The Advanced Bash-Scripting Guide has some exercises.

I just found this resource which has some helpful examples:

Hi nickednamed...

It really depends on what one considers as interesting.

One man's interesting is another man's dull.

I will certainly keep a keen eye on this thread however in case it develops further.

BTW I am a learner too...

My approach has been to attempt answering threads here. The problems we get are messy and difficult, quite unlike the neatly packaged ones often found in books and guides.