Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Some *nix help, if you would?

  • 14-09-2009 12:59PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 2,534 ✭✭✭FruitLover


    sed is probably the man for this


  • Registered Users, Registered Users 2 Posts: 1,110 ✭✭✭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, Registered Users 2 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