Results 1 to 1 of 1

Thread: Bash scripting: how to remove or sort lines in curl feed

  1. #1
    Join Date
    Dec 2010
    Location
    Estonia
    Beans
    101
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Bash scripting: how to remove or sort lines in bash

    If i fetch data using curl and cut only few characters from it, say cut -c1-2, it cuts those characters from all the lines within the fetched data.
    So if data received was:
    JJJJ 99304
    1234950

    then end result after applying cut would be:
    JJ
    12

    How could only JJ be cut from the feed?

    EDIT:
    answer is the sed command. To cut only, for instance 2nd line, this should be used:
    Code:
     | sed -n 2p
    Last edited by layr; October 7th, 2011 at 04:21 PM. Reason: Found the answer to my question

Bookmarks

Posting Permissions

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