Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004

    Bash script help

    hi guys..
    i need assistance to solve the problem
    i hav a file having many records, the format is following

    905-508-6356 Tool Shop Schacher Mel
    416-967-22 Maintenance Schenker Michael
    416-967-2208 Sales Vai Steve

    now i wana display first 10 records when display, then ask to input 'd' to search departments starting from 'd'. or input 'f' to display first names matching .
    the other important thing is to ask input 'n' to goto next 10 records or press 'p' to show previous 10 records.

    please help me to solve this prob.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Täby, Sweden
    This sounds suspiciously much like someone's homework to me, so therefore I'm intentionally going to give vague hints:

    1. As for selecting a certain number of lines, see the `head' and `tail' command.
    2. As for searching, see the `grep' command, and also the regex(7) manpage.
    3. As for giving the user some kind of choice, see either the `read' command or the `select' command.

    Always remember -- `man', for displaying manual pages, is your friend.

  3. #3
    I answered this one on another forum - awk solution.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts