Help with shell scripting

HI guys,
I need to check the base.txt file with the base.lck file and get a resulting base file which checks the last number in the base.lck file and starts with the number after the numbers in the base.lck file.
Here the base.txt is the list of numbers.
The base.lck file is something like a buffer which stores the numbers which are used from the base.txt file
lets name the resulting file as result.txt
Please try out and help me..
thanks in advance...

What did you try so far? Any particular problem you got stuck with?

im relatively new to this shell scripting...
This is just a part of my task which i am not able to solve
I solved other tasks and i need this to get solved and move on in this program execution

---------- Post updated at 01:17 PM ---------- Previous update was at 01:14 PM ----------

i donno how to get to the base.txt file which checks the base.lck file

---------- Post updated at 02:33 PM ---------- Previous update was at 01:17 PM ----------

what do i need to code
??

---------- Post updated at 02:45 PM ---------- Previous update was at 02:33 PM ----------

plz post ur replies...i need answers

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

vishva79, I think you will have to provide more detail and a better description of your problem, perhaps an example. I for one do not understand what you mean.

E.G:
vim file1.txt
98908999897
76956987698
76760879878
21319847985
12423756867
23453647876
23534654567

vim file2.txt
98908999897
76956987698
76760879878

Here file2.txt gets updated frequently.i.e.the last number is not constant.

I want a file3.txt which can check the status of the file2.txt i.e.last number....and can insert next number on wards into a seperate file.

If u can understand my problem,plz respond.Thanks.

Perhaps this ?

awk '/'$(tail -1 file2.txt)'/{pr=1; next} pr == 1 ' file1.txt > file3.txt

Dint get the answer..
anyways thanks a lot for ur help..

Perhaps something less cryptic then?

start=0
prev=$(tail -1 file2.txt)            # set prev to the last record in file2.txt
while read rec; do                   # read every record in file1.txt
  if [ $start -eq 1 ]; then          # if it is time to start printing,
    echo $rec                        # print record to file3.txt
  fi
  if [ "$rec" = "$prev" ]; then      # if record matches prev
    start=1                          # start printing the record after this record.
  fi
done < file1.txt > file3.txt