Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Unanswered: Shell scripting problems

    Im very new to shell scripting and just cant seem to understand how to take the content of one file and copy a certain amount of the data into a second file. For example if file1 has 30 lines and i want to copy lines 21 to 28.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    use the tail command

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Or maybe the sed command:
    Code:
    sed -n '21,28p' infile >outfile

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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