Sponsored Content
Top Forums Shell Programming and Scripting 100 interesting shell scripting problems Post 302849409 by nickednamed on Sunday 1st of September 2013 09:57:27 AM
Old 09-01-2013
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 03:35 PM.. Reason: Grammar, style
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
ARITHMETIC(6)							 BSD Games Manual						     ARITHMETIC(6)

NAME
arithmetic -- quiz on simple arithmetic SYNOPSIS
arithmetic [-o +-x/] [-r range] DESCRIPTION
arithmetic asks you to solve problems in simple arithmetic. Each question must be answered correctly before going on to the next. After every 20 problems, it prints the score so far and the time taken. You can quit at any time by typing the interrupt or end-of-file character. The options are as follows: -o By default, arithmetic asks questions on addition of numbers from 0 to 10, and corresponding subtraction. By supplying one or more of the characters +-x/, you can ask for problems in addition, subtraction, multiplication, and division, respectively. If you give one of these characters more than once, that kind of problem will be asked correspondingly more often. -r If a range is supplied, arithmetic selects the numbers in its problems in the following way. For addition and multiplication, the numbers to be added or multiplied are between 0 and range, inclusive. For subtraction and division, both the required result and the number to divide by or subtract will be between 0 and range. (Of course, arithmetic will not ask you to divide by 0.) The default is 10. When you get a problem wrong, arithmetic will remember the numbers involved, and will tend to select those numbers more often than others, in problems of the same sort. Eventually it will forgive and forget. arithmetic cannot be persuaded to tell you the right answer. You must work it out for yourself. DIAGNOSTICS
``What?'' if you get a question wrong. ``Right!'' if you get it right. ``Please type a number.'' if arithmetic doesn't understand what you typed. SEE ALSO
bc(1), dc(1) BSD
May 31, 1993 BSD
All times are GMT -4. The time now is 05:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy