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
Hint: Use Awk command
thanks for your help
I think the best solution would be for you to do your own homework.
(It was either that, or give him a completely wrong but still convincing answer - and that, while infinitely more just, would also have taken more than 30 seconds.)