MODERATORS

I am relatively new to shell scripting. I have decent knowledge of basic command line tools (sed, awk, etc.) but I want to develop functional proficiency with larger scripts. It's much easier to learn a language if you have something that you want to accomplish. Any suggestions for beginner level projects that are actually cool or useful?

a) A small TODO-App. This is best with some limitations: Save every entry as one line to a file and number it.

b) A way to execute the last command with sudo (bonus points: "su -c"). Mine is called "please".

c)Randomly choose a song to play from your music directory and play it.

One thing though: Often when dealing with filenames, you need to deal with spaces in them, too. The most robust way to do that is to only pass them separated with the null-byte (the only character that isn't allowed in filenames) - this can be done with e.g. "find" with the "-print0" option.

Also: man is your friend.

EDIT: As a bonus, something a little more complicated.

I've had a lot of closed-source games on my system, and sometimes (okay, most of the time) they aren't available as a package for my distro.

So, what I did was make a small script (in its current state one line, though it only handles the easy case), that tells me which packages are needed by the binary of the game.

So, for example if I'd like to know what packages Jamestown needs and which are missing, I run

Think of anything you do that takes more than 10 minutes to accomplish it. Seriously.

Instead of downloading a package, installing it, configuring, starting it...just try scripting the whole thing. Back-up the old config file(s) if they exist, and have it generate a log showing you what's done, make it show you all sorts of "i'm doing step derp" things as it runs.

You might already be past that point skill-wise but, if not, it's an excellent way to learn. So many nuances to what appear to be very simple things.

Try it on for size and then start thinking about what you really want to script.