Hi there, I'm trying to find a way to do a few scripts but I am really struggling, I have no idea where to even start, I just sit and stare at nano until it eventually beats me in our staring contest and I go to bed and worry!! I have to make a serious scripts (10 to be exact) that all accomplish different things, can someone please please please help! I'll be eternally grateful the scripts I have do are the following:
1.Motd
Write a script to display a message of the day (motd). The message should be held in a file with a known location, for ease of updating the file for many users.
2.Unindent
Reading from standard input, unindent each line and write the result to standard output. Use a parameter to control what form the indent takes. By unindenting the lines means removing the specified indent from the beginning of the line, take care only to remove one copy in the case of multiple indents.
3.Generate a sequence of numbers
Write out a sequence of page sizes for the A series of paper sizes (
http://en.wikipedia.org/wiki/Paper_size). For each write out the name, width and height (e.g. A4*210*297) start at A0 and go to the size given as a parameter, so for a parameter of 8 write out the sizes A0 to A8 one per line.
4.Generate a list of pixels
Given two parameters write out the list of pixels. For parameters 2 3 the sequence is:
(0 0) (0 1) (0 2)
(1 0) (1 1) (1 2)
5.Display the first n lines of the input.
Write your own version of the head command (do not simply put a wrapper round head). The program should display the first n lines of a file where n is given as a parameter and the file read from standard input.
6.A wrapper for file operations, provides a menu and confirmation.
Write a script that provides a wrapper for file operations, deleting, renaming and moving. It should provide clear lists of actions, prompts and conformation to describe the actions it is to take.
7.Template – default values
Often I need to generate a common piece of text, such as a copyright statement for a program. It has a number of values that need filling in, such as the date, version and author. Write a script to fill these values into a header comment.
/* copyright (c) <date>
* by <author>
* version <version>
* Some legal stuff about coping and as is software...
* caveat utilitor
*/
8.Version control
A simple form of version control can be done as follows. A directory is used as a store. When a file is checked into the store a version number is added to the end of the filename. For example memo.txt becomes memo.txt;1 memo.txt;2 etc. Each time the next number in the sequence is used. Two scripts are needed, one to store the next version in the store. The other script retrieves a given version number from the store.
9.Maintain a dictionary
A dictionary is a list of known spellings of words. This needs to be maintained and updated periodically. Words need to be added and the dictionary kept in the right order. Write a script to take a given word and insert it into the dictionary if it does not already exist, preserving the sorted order of the file.
10.A simple address book program.
A simple address book can be stored, one entry per line, with suitable characters separating fields (TAB or colon). A script (or scripts) manages the address book, functions include adding and deleting entries, searching for entries and displaying the entry in a more readable format than that used in the file.
Example: Alun Moon:alun.moon@northumbria.ac.uk:x7622:Pandon 125
I accept this is a Linux forum but I'm so stuck and time is running out for me! please please help!
many thanks in advance!!
--
Andy Brown