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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Some *nix help, if you would?

  • 14-09-2009 11:59am
    #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