The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Calling expect scripts from other expect scripts seva Shell Programming and Scripting 0 04-03-2008 10:45 AM
scripts rakshit HP-UX 1 01-15-2008 01:52 AM
exercises in shell rohitv UNIX for Dummies Questions & Answers 1 09-21-2006 03:23 PM
su in scripts soots Shell Programming and Scripting 6 10-27-2005 05:40 AM
Scripts GW01 UNIX for Dummies Questions & Answers 3 12-11-2002 04:06 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2008
Registered User
 

Join Date: Jan 2008
Posts: 6
Shall Scripts exercises

I have just 3 things that I really need to know the solution, please allow me to show it.

any help would be nice

script that backup a file. The file name to backup should be provided as input parameter, the backup file should have the same file name with the extension ".bak". If the user provides no input parameter, the script should display an error message. If there is an input file name, but it does not exist, the script should display an error message. If the input file exists, the script should create the backup file and overwrite any existing backup file with the same name.

---

script (called phone) that creates a simple telephone list (create an empty file called “phonlist” in home directory) . Each line in this file consist of two fields name and the phone number, the script should do the following:
When user types the command : “phone new <name> <number>” this will add new record (name,number) to the list.
When user type command: “phone <name>” then the script should search in the file “phonelist” and gets the phone number and display the result.

---

a complex command using pipes to Calculate the number of hits per client in Squid log file (access.log), the command should display most active hosts first.

Line example

1197979501.787 1 10.1.14.62 TCP_NEGATIVE_HIT/404 1463 GET http://url

The output should be like:

34 10.1.14.3
33 10.1.14.5
22 10.1.16.1
18 10.1.18.1

I'm deadly need to understand the solutions, I think its a huge step for me to learn the programming on this script.

thanks
Forum Sponsor
  #2 (permalink)  
Old 02-03-2008
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
You appear not to have read the rules. Please do so before posting again.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:32 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0