shell script ?

From: boby (bobysandz@yahoo.com)
Date: Wed Oct 23 2002 - 23:17:53 EDT


hi

would you please tell me the best solution for the following question ? with awk command ?

2. Write a script called "inventory" which is used to increment
    or decrement an item's quantity in an inventory file. Assume
    that the item name is in column 5 (the last column), and the
    quantity is in column 2. There are 3 arguments: the name of
    the inventory file, the name of the item, and a number which is
    positive for an increase and negative for a decrease. For example,

    $ inventory invfile1 pencils -27

    would decrease the quantity of pencils by 27 in file invfile1.
    Issue error messages if the script is called with anything other
    than three arguments, and if the item cannot be found in the
    inventory file.

 

   Hint: Use Awk command

thanks for your help

boby
New DSL Internet Access from SBC & Yahoo!
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:09 EDT