unix help (using pipe head, tail, and grep)

Discussion in 'Mac Basics and Help' started by scan, Feb 6, 2006.

  1. scan macrumors 6502

    Joined:
    Oct 24, 2005
    #1
    how would I pipe head, tail, and grep together to search for something from line 11-17 of a file?
     
  2. iMeowbot macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #2
    ( head -17 | tail -7 | grep whatever ) < filespec

    What do I win?
     
  3. superbovine macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003
    #3
    an A on his homework....
     
  4. iMeowbot macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #4
    I'd give that a D for not checking that there are 17 lines in there :)
     
  5. superbovine macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003
    #5
    since when does the overworked grad student care about error checking ;)
     
  6. scan thread starter macrumors 6502

    Joined:
    Oct 24, 2005
    #6
    damn, i was so close. I just didn't redirect the file. thanks
     

Share This Page