The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   does "sed" work differently on Darwin/tcsh? (http://hintsforums.macworld.com/showthread.php?t=7283)

mervTormel 11-26-2002 09:46 AM

hmm, odd moovees with odd problems. IE Save As... here gets the same disk full error. slurp it commando...

$ curl -O http://home.mindspring.com/~bduart/tobor.mov

thatch 11-26-2002 02:22 PM

Thanks mT, curl worked great and same for Paul's movie too. I guess I ought to submit yet another bug report on IE.

sox 11-26-2002 05:03 PM

Above examples wont work
 
The perl, and awk lines given above wont work with multi-line html tags

instead
curl <url> | perl -we 'undef $/; $s = <>; $s =~s/<[^<]*>/ /g; print $s'
should do the job in one line.

osxpez 11-26-2002 05:17 PM

Re: Above examples wont work
 
Quote:

Originally posted by sox
The perl, and awk lines given above wont work with multi-line html tags
Did you even try the awk line? Why wouldn't it work? I wrote it to work since the original sed line dealt with it. It works for me.
Quote:

From the perlvars man page
Remember: the value of `$/' is a string, not a
regex. awk has to be better for something. :-)

sao 11-29-2002 11:30 AM

A bit late, but...

Just realized I coud use "w3m" for local files also:

$ cat foo.html | w3m -dump -T text/html >foo.txt

works fast and well.


Cheers...

osxpez 11-30-2002 07:22 AM

UUOC!
 
UUOC watchdog (me) says:

Save typing, resources, and nag-points by doing it like this instead:

w3m -dump -T text/html <foo.html >foo.txt

sao 11-30-2002 10:30 AM

osxpez,

I knew I would win somethings: "Useless Use of Cat Award" ...Thanks! :D

I will make sure I put the 'cat' away and use it as you suggested.


Cheers...

osxpez 12-04-2002 06:06 AM

surfraw
 
I just found the most excellent use for "links -dump"!!!

I've not been using surfraw all that much since it insisted on fireing up an UI based browser. Not "raw" enough for me. But with these lines in my surfraw.conf:

def SURFRAW_graphical no
def SURFRAW_text_browser links
def SURFRAW_text_browser_args -dump

doing a command like this:

$ webster marshmallow

I get output like this:

Code:

  Merriam-Webster home              IFrame                    [IMG]

  [IMG] Home    [IMG]                                    Download the new
  Help                            [USEMAP]              Merriam-Webster
  [IMG] Word of the                                      Toolbar and look
  Day                    One entry found for            up words anywhere
  [IMG] Word Games        marshmallow.                  on the Web - it's
  [IMG] Word for the                                          free!
  Wise
  [IMG] Books and CDs    Main Entry: marsh.mal.low        ____________
  [IMG] Company Info      [IMG]                          [ Dictionary ]
  [IMG] Customer          Pronunciation:
  Service                'ma:rsh-"me-lO, -"ma-            ____________
  [IMG] Network          Function: noun                  [ Thesaurus ]
  Options                Date: before 12th century
  [IMG] Language Zone    1 : a pink-flowered European
  [IMG] The Lighter      perennial herb (Althaea        _________ [ Find ]
  Side                    officinalis) of the mallow
  [IMG] Site Map          family that is naturalized    [IMG]
                          in the eastern U.S. and has
        Log in to        a mucilaginous root            +---------------+
      Merriam-Webster      sometimes used in              |[ Ask Jeeves ] |
        Unabridged        confectionery and in          |  ________    |
      Member Log-in      medicine                      |  [ Ask! ]    |
                          2 : a confection formerly      +---------------+
    Shopping              made from the root of the
                          marshmallow but now usually    +---------------+
                          made from corn syrup, sugar,  |    Put a    |
          [IMG]            albumen, and gelatin beaten    |Merriam-Webster|
    NEW! Britannica        to a light spongy              | dictionary on |
    2003 Ultimate          consistency; also : a piece    |  your Palm  |
    Reference Suite        of partially dried            |    Pilot!    |
    DVD                    marshmallow <a bag of          +---------------+
    Price: USD $69.95      marshmallows>
    Only $49.95 after      - marsh.mal.lowy [IMG]
    mail-in rebate!        /-"me-l&-wE, -"ma-/
                          adjective

If that's not cool and useful, then what is??

sao 12-05-2002 09:20 AM

osxpez,

I tried it and works very well, and it looks stormy in Singapore with:

$ wetandwild singapore

Code:

Edited

Tonight: Scattered thunderstorms this evening with a few showers still possible             
overnight. Low 77F. Winds light and variable. Chance of rain 40%.                           
                                                                                                             
Tomorrow: Variable clouds with a chance of thunderstorms. High 87F. Winds light and         
variable. Chance of rain 60%.                                                               
                                                                                                               
Tomorrow night: Thunderstorms likely. Low 77F. Winds light and variable. Chance of           
rain 70%.                                                                                   
                                                                                                               
Saturday: Scattered thunderstorms in the morning, then mainly cloudy during the             
afternoon with thunderstorms likely. High 87F. Winds N at 5 to 10 mph. Chance of             
rain 70%.                                                                                   
                                                                                                   
Sunday: Scattered thunderstorms. Highs in the upper 80s and lows in the upper 60s.           
                                                                                                             
Monday: Thunderstorms likely. Highs in the upper 80s and lows in the upper 60s.


Cheers...

osxpez 12-05-2002 05:03 PM

Cool! But not very useful for a swede. I don't understand Farenheight! =)


All times are GMT -5. The time now is 05:36 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.