Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Some *nix help, if you would?

Options
  • 14-09-2009 12:59pm
    #1
    Registered Users Posts: 1,127 ✭✭✭


    Id like to create a cron job to grab RSS and store locally. There's some spurious content at the start of this xml, so Id like to strip it out. How do I take the results of a wget, pass to a tr and store the file locally. I have a feeling Im almost there:
    wget http://example.com/rss.xml | tr -cd '\11\12\40-\176' 
    

    Any ideas?


Comments

  • Registered Users Posts: 2,534 ✭✭✭FruitLover


    sed is probably the man for this


  • Registered Users Posts: 1,109 ✭✭✭Skrynesaver


    First off wget saves to a file, so you need to either act on the file or set STDOUT to the pipe eg.
    wget  -q -O - http://example.com/rss.xml 
    

    Then if your tr command works you're in business


  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    super, set me on the right track.
    wget  -q -O - http://example.com/test.xml | tr -cd '\11\12\40-\176' > output.xml 
    

    seems to do the trick.


Advertisement