FreakScene.net

Dinosaur Jr. Fan Community

Menu

Skip to content
  • Home
    • News
  • Artists
  • Song Lyrics
  • Links
  • Contact Us
    • Privacy Policy
  • Forums
    • Latest Topics
    • Dinosaur/J News & Discussions
    • Dinosaur Related Discussions
    • General Discussions
    • Bootleg Trading
    • Guitar Room
    • Fossils
    • Get Discovered
    • Introductions
    • Site Suggestions + Comments
    • Live reviews / meetups
    • Open Topic
    • Area 51
    • Musicians & D.I.Y. Artists

the unix command sed

Forums › Forums › General Discussions › Open Topic › the unix command sed

  • This topic has 4 replies, 3 voices, and was last updated 22 years, 8 months ago by bob.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 6, 2003 at 12:35 pm #45728
    bob
    Participant

      Hey,
      trying to write a script that will take a html file and removing everything but the local links.

      menu.html
      faq.html
      stuff/morestuff.html

      etc.

      I think the sed command is what I want but maybe there’s a better way

      I tried sed – e ‘/"//g’ index.html

      and this removed all of the double quotes but I can’t make it remove all of the single quotes

      I guess how I think the program should work is to remove all double and single quotes then remove all lines that don’t include <a and href then remove everything that’s not between href= and > after that removing everything after .html

      anyone think of a better command, algorithm, how to do the single quote thing, or how to do something that will replace everything BUT

      February 6, 2003 at 5:22 pm #91220
      Mattman
      Participant

        Hmm, I don’t know that I fully understand what you’re trying to do, but I’ve noticed in several programming/scripting languages that if you need it to recognize a single quote, then use ‘ or ” (two single quotes together.)

        Might work… Good luck. :D

        February 6, 2003 at 6:45 pm #91221
        bob
        Participant

          yeah, I was in c shell and that’s why it did that, I did the thing now and it solved it.
          Now I have to figure out how to run sed on shell variables

          March 27, 2003 at 10:55 pm #91222
          nickburnz
          Participant

            man sed

            :P

            March 28, 2003 at 1:28 am #91223
            bob
            Participant

              here’s how I figured it out
              with sed you don’t have to use / as delims for substittute you can use anything – for example

              as for how to set a variable to the results of a command put

              var1=`command`

              need to use the ` things

            • Author
              Posts
            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.
            Log In
            Proudly powered by WordPress | Theme: Illustratr by WordPress.com.