100 interesting shell scripting problems


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting 100 interesting shell scripting problems
# 1  
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".

All I need are suggestions for interesting problems to solve using shell scripting.

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

Last edited by nickednamed; 09-01-2013 at 04:35 PM.. Reason: Grammar, style
# 2  
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.
# 3  
Quote:
Originally Posted by nickednamed
Hi all,

I'm
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).

Nickednamed
I think this is interesting, and would be willing to participate if it was about shell scripting. If you look at reddit.com/r/dailyprogrammer and take their model but limit it to bash / linux I think that would be interesting.
These 2 Users Gave Thanks to briandanielz For This Post:
# 4  
Quote:
Originally Posted by figaro
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.
...
You could copy examples from these sites, but it would still defeat the purpose though.
Yes, I do realise that. You can trust me Smilie

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 ----------

Quote:
Originally Posted by briandanielz
I think this is interesting, and would be willing to participate if it was about shell scripting. If you look at reddit.com/r/dailyprogrammer and take their model but limit it to bash / linux I think that would be interesting.
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.
# 5  
The Advanced Bash-Scripting Guide has some exercises.
These 2 Users Gave Thanks to Ygor For This Post:
# 6  
I just found this resource which has some helpful examples:
http://rosettacode.org/wiki/Category:C_Shell
# 7  
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...
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #77
Difficulty: Easy
MINIX was a Unix-like operating system created for educational purposes.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Code commenting Problems in shell scripting

Hi Friends, I Want to comment one line of code from below code. DBA_ORACLE_USER=`DB.sh -u -a User` DBA_ORACLE_PWORD=`DB.sh -p -a User` sqlplus /nolog <<-END > ${logfile} 2>&1 WHENEVER OSERROR EXIT 9 WHENEVER SQLERROR EXIT SQL.SQLCODE connect... (3 Replies)
Discussion started by: as234301
3 Replies

2. Shell Programming and Scripting

Execution problems with scripting

Hi, I am new to scripting.I had one problem infront of me.I tried in many ways with minimal knowledge........Kindly help me. Description: I want a shell script where it has to read an input.txt file and need to remove duplicate lines and the result need to kept in output.txt file. input... (5 Replies)
Discussion started by: bhas
5 Replies

3. Shell Programming and Scripting

Unix scripting problems

Hi, In my unix server, i received a file in /usr/data/xmit location. i want to write a unix script after file reached. So how can i write a one line code which chceks the presence of the file? and second line line should take the status of the prevous line. like below. Line 1: checks for the... (16 Replies)
Discussion started by: JSKOBS
16 Replies

4. Programming

shell scripting problems involving operations with remote machine

Hi, i have been developing a shell script to transfer a set of files from one ubuntu system to another. Task: while executing the script the files ( ls, dir, cat) in the source machine should transfer to destination machine(at /home/mac/mac/bin) While the script is executed once again, It... (0 Replies)
Discussion started by: srijith
0 Replies

5. Shell Programming and Scripting

Shell scripting problems - Commands not on local machine

Hello all- I have done a lot of searching tonight, but all leads seem to be dead ends. Forgive me if this has been covered, but I've searched the forum and the internet. I am having trouble building a shell script which uses SSH to login to our schools 1024 cluster grid. The issue that I am... (1 Reply)
Discussion started by: Sagan
1 Replies

6. Shell Programming and Scripting

Beginner bash scripting - a few problems

Hey Guys, I am creating a bash script on my freeBSD box, the script should basically ask the user to enter a username and domain. The script will take this information and basically append alot of information to config files so the user can receive email from that domain and create a web site at... (1 Reply)
Discussion started by: traxy
1 Replies

7. Shell Programming and Scripting

shell scripting on unix/mysql problems

Hi, I have written a shell script for oracle on unix that does a df for specific files, and then will display the size, Avail, % used and the difference from yesterday to today. I have been asked to place it on some MySql databases that run onn unix and linux also, but when I try to run them I... (2 Replies)
Discussion started by: cat55
2 Replies

8. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

9. Shell Programming and Scripting

Scripting problems

Hello, Im trying to write a script where it will only execute on a certain day. What would the script look like? if then do this is this correct?? (13 Replies)
Discussion started by: lewisoco
13 Replies

10. Shell Programming and Scripting

Scripting file permission problems...

Hello all - I have two systems. 1) Linux box running Redhat 8.0 2) Tru64 box running V4.0f From the Linux box I am remotely mounting a directory (nfs mount) that resides on the Tru64 machine. The directory that is nfs mounted contains two subdirectories: my_dir1 my_dir2 I want... (3 Replies)
Discussion started by: Heron
3 Replies

Featured Tech Videos