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)

steve_rothman 11-21-2002 09:57 AM

does "sed" work differently on Darwin/tcsh?
 
I'm working with a nice list of sed one-liners, from:

http://sed.sourceforge.net/grabbag/t.../oneliners.txt

Some seem to work great on my 10.2 system, but some don't. The one I'm especially interested in is a one-liner to strip html from text files:

# remove most HTML tags (accommodates multiple-line tags)
sed -e :a -e 's/<[^<]*>/ /g;/</{N;s/\n/ /;ba;}'

This gives me an error msg:

sed: 1: "s/<[^<]*>/ /g;/</{N;s/\ ...": unexpected EOF (pending }'s)

I don't know enough about sed to debug this, I assume the one-liner is basically correct and this may be an issue with tcsh?

Any hints?

osxpez 11-21-2002 10:16 AM

It's not tcsh. But GNU sed is very much like vanilla sed on steroids and it might be that OSX doesn't come with GNU sed. Try installing sed with fink and you shall find that that one liner will work.

steve_rothman 11-21-2002 10:32 AM

Thanks for the tip. If anyone already has GNU sed installed, can you try this?

I believe it is intended to work with the plain vanilla sed, and I try to avoid stuff with steroids when they're not necessary. :)

I noticed warnings in the sed documentation that some examples don't work properly in bash or tcsh shells. The problems I saw mentioned (like using a "!") don't seem to affect this example but I think it's quite possible that the shell is "interpreting" some portion of the one-liner and not sending the right parameters to sed?

sao 11-21-2002 10:34 AM

steve_rothman,

Or install, also with Fink:

ssed-3.58-1
Description:------Super stream editor

based on GNU sed 3.02.80 several new features (including in-place editing of files, extended regular expression syntax and a few new commands).

Check it up here:

http://sed.sourceforge.net/grabbag/ssed/


Cheers...

osxpez 11-21-2002 11:20 AM

Quote:

Originally posted by steve_rothman
Thanks for the tip. If anyone already has GNU sed installed, can you try this?
I tried it on a GNU/Linux box with both bash and tcsh. It works. (Even if it outputs a lot of empty lines, so it can be improved.)
Quote:

Originally posted by steve_rothman
I believe it is intended to work with the plain vanilla sed, and I try to avoid stuff with steroids when they're not necessary. :)
But GNU sed is the defacto standard so you probably should be using it. :)
Quote:

Originally posted by steve_rothman
I noticed warnings in the sed documentation that some examples don't work properly in bash or tcsh shells. The problems I saw mentioned (like using a "!") don't seem to affect this example but I think it's quite possible that the shell is "interpreting" some portion of the one-liner and not sending the right parameters to sed?
Well, in this case the sed script is fully enclosed in single quotes, and not even tcsh should be able to touch it! :)

mervTormel 11-21-2002 11:29 AM

another (right) tool for the job...
Code:

$ cat ~/bin/dhtml

#!/usr/bin/perl -w

#strip html tags

while (<>) {
  $_ =~ s/<[^>]*>//g;
  print;
}

$ curl -s http://checkip.dyndns.org | dhtml
Current IP Check


Current IP Address: x.x.x.x
Hostname: foo.bar.blaz.com

[edit: concede to pez's claim -mt]

osxpez 11-21-2002 12:05 PM

Well sed seems to be the right tool for the job as well. Using the one-liner above:

$ curl -s http://checkip.dyndns.org | sed -e :a -e 's/<[^<]*>/ /g;/</{N;s/\n/ /;ba;}'

Avoids bringing up a a bloaty Perl interpreter. Then you have awk:

$ curl -s http://checkip.dyndns.org | awk -v RS='<[^<]*>' '{print}'

sao 11-21-2002 02:17 PM

steve_rothman,

I think you better follow osxpez good advice.

It also works well in tcsh:
Code:

1 [sao @/Users/sao] : curl -s http://checkip.dyndns.org | sed -e :a -e 's/<[^<]*>/ /g;/</{N;s/\n/ /;ba;}'
  Current IP Check 
 

 Current IP Address: x.x.x.x
 Hostname: bubu-00-00-00.papata.bata.lata


Cheers...

osxpez 11-21-2002 02:48 PM

gawk
 
I don't know why Apple choose to not use more GNU tools. But when I tried my own awk one-liner on my Mac i see that it doesn't work! I haven't checked what version of awk that comes with OS X, but it's neither mawk nor gawk, because then it would have worked. (Both treats RS as a regexp.) The fix was surprisingly simple:

$ sudo apt-get install gawk

'Surprisingly' because since Jaguar, few packages have been apt-get-able and I have gotten quite used to being forced to use fink. gawk seems to be in the exclusive set of tools that has a binary dist.

sao 11-21-2002 03:17 PM

osxpez,

There are several packages you could install with apt-get now, although I don't recommend it in Jaguar, until they release Fink-0.5.0. which will be probably next week, and then, quite a few binary packages will be available to install with apt-get and dselect.

By the way, 'fink install gawk' takes from start to finish, exactly 3 minutes on an iMac 400 MHz.


Cheers...

osxpez 11-21-2002 03:32 PM

It took just a few seconds using apt-get. :) When you say several packages being available through apt-get. Do you mean the 15 or so packages (of which most of them are Fink stuff) listed by "dpkg -l" or can I reach other packages as well?

Fink 0.5.0 within a week! That's great news! Any idea of when we can have a kde 3 on Jaguar? One of the things I lack the most from 10.1 is Eterm. xterm sucks ass since it's slower than a pregnant cow swimming in maple syrup. Will I see Eterm in Fink 0.5.0 you think? Sorry for straying away with this thread. ...

pmccann 11-21-2002 08:48 PM

Sorry, but giggling seems highly appropriate at this stage!

Avoid bringing up a "bloaty" perl interpreter; instead use awk. No, not awk, but *sed*, you know, the new "default" sed. Not the sed that you might have. Or awk, but not *awk*, the *real* awk, which is gawk (or maybe you might need mawk, who knows? Hang on, maybe that's nawk? Now which version was it that changed the regular expression syntax to the way that I use it here?). Just download the appropriate version; takes hardly any time at all (compared to starting up that bloaty perl interpreter!).

Redux: if you're running a machine that's capable of "producing" Mac OS X then the time spent wondering whether to use a porcine perl or an antsy awk or a slender sed is a dozen times longer than it would take to run any of these utilities a dozen times.

If you want to wear a belt with a corkscrew, a knife, a gknife (the new standard -- of course!!) a hoof-cleaner (for wildebeest) and a pair of scissors attached then that's your business, and maybe that of the fashion police. Give me a swiss-army chainsaw any day. It'll be cranked into action in a fraction of the time that you spend sorting through your dinky dingly dangly dongles. Reminds me of a very silly little piece of video: "why sumo is better than karate"....

http://www.nivenspaws.com/whysumoisb...hankarate.mpeg

Cheers,
Paul (guess I should add in a debitchifying smiley at this stage? ;) )

ps forgive me: it's been a really bad couple of days...

mervTormel 11-21-2002 09:02 PM

ha! thanks, /usr/bin/paul -- i appreciate your perspective.

somewhere i saw 'snawk' -- new and improved awk! now with more sed!

sao 11-21-2002 11:27 PM

osxpez,

Yes, still I would tell you that the only way to install in Jaguar at the moment is from source and to wait for Fink-0.5.0 to install binaries using apt-get.

About kde 3, in reality it already does work very well on Jaguar, you just have to install it from source. Same for Eterm. I really don't know which binary packages will be inmediately available with the new release.

As you know, the quantity of packages available in binary much depends on the feedback given to the maintainers, so if there is positive feedback about using a package in unstable, they can move it to the stable branch. For the last month or so, the Fink maintainers have being calling for feedback from users, preparing for the release of 0.5.0.


Cheers...

osxpez 11-22-2002 01:08 AM

paul: Sorry if I stepped on a soar Perl toe. :) I still think it's worthwhile to have the GNU versions of awk and sed. (And if you think it was about regexp syntax you should check again, the same expression was used through all seds/awks and even Perl.) By the way I've seen people using MS Word macros for tasks like stripping HTML. In that comparison Perl seems light weight. (And awk and sed more like spit in the ocean.)

sao: Eterm and KDE 3 are not available via fink (as far as I can see) so there's no way to test them in unstable. What do you mean by installing them from source? Grab the tar balls from the respective sites and have a go? I might do that with Eterm.

thatch 11-22-2002 02:41 AM

osxpez, I find eterm and KDE 3 stuff when I do a 'sudo fink list':

eterm 0.9-1 Color VT102 terminal emulator
----

kaboodle 3.0.7-3 KDE - simple media player
kalzium 3.0.7-3 KDE - periodic table
kaphorism 3.0.7-3 KDE - display proverbs and aphorisms
...
kxine 0.5-0.20020 KDE DVD and video player.
kxmlrpcd 3.0.7-3 KDE - inter-process communcation server

----

A 'sudo fink install eterm' should certainly work for a compile from source. KDE would take a long time but is also doable.

I don't know if those are in unstable or not for your testing. I think those listed are more likely stable versions but I could be wrong. I guess that running the 'sudo fink selfupdate-cvs' and then a 'fink update-all' afterwards would get you the latest available though.

sao 11-22-2002 04:43 AM

osxpez,

I missed your last post above, sorry. (just read it)

Like thatch said, if you run 'fink selfupdate-cvs' , and 'fink update-all', they will come up sooner or later in your 'sudo fink list'.

What's you fink version right now?? (fink -V)


Cheers...

sao 11-22-2002 04:48 AM

thatch, osxpez,

Actually, in Jaguar (10.2) you can install right now from source, with 'fink install packagename' the following KDE 3 packages:
Code:

228 Sao  @ ~  $ fink list -i --section=kde
Information about 1759 packages read in 1 seconds.

 i  amor                  3.0.7-3          KDE - themeable animated window toy
 i  ark                    3.0.7-3          KDE - archive utility
 i  arts                  1.1.0-3          KDE - analog realtime synthesizer
 i  arts-dev              1.1.0-3          KDE - static libraries and headers for aRts
 i  atlantik              3.0.7-3          KDE - monopoly-like game
 i  flashkard              3.0.7-3          KDE - vocabulary studying tool
 i  kalzium                3.0.7-3          KDE - periodic table
 i  kaphorism              3.0.7-3          KDE - display proverbs and aphorisms
 i  karbon                1.2.0-3          KDE - vector-based drawing program
 i  kasteroids            3.0.7-3          KDE - asteroids clone
 i  katomic                3.0.7-3          KDE - sokoban-like game
 i  kbackgammon            3.0.7-3          KDE - backgammon board game
 i  kbattleship            3.0.7-3          KDE - battleship clone
 i  kblackbox              3.0.7-3          KDE - blackbox clone
 i  kbounce                3.0.7-3          KDE - catch moving balls
 i  kcalc                  3.0.7-3          KDE - scientific calculator
 i  kcharselect            3.0.7-3          KDE - character set selector
 i  kchart                1.2.0-3          KDE - charting and diagram drawing
 i  kcoloredit            3.0.7-3          KDE - color palette editor
 i  kde-extra-kfile-plugi  3.0.7-3          extra file I/O plugins
 i  kde-extra-screensaver  3.0.7-3          KDE - extra screensavers
 i  kde-extra-sounds      3.0.7-3          KDE - extra sounds for startup and logout
 i  kde-extra-themes      3.0.7-3          KDE - extra window styles and themes
 i  kde-extra-wallpapers  3.0.7-3          KDE - extra wallpaper images
 i  kde-icons-crystal      3.0.7-3          KDE - "Crystal" icon set
 i  kde-icons-ikons        3.0.7-3          KDE - "ikons" icon set
 i  kde-icons-locolor      3.0.7-3          KDE - "Locolor" icon set
 i  kde-icons-slick        3.0.7-3          KDE - "slick" icon set
 i  kde-icons-technical    3.0.7-3          KDE - "Technical" icon set
 i  kde-panel-eyes        3.0.7-3          KDE - xeyes panel applet
 i  kde-panel-fifteen      3.0.7-3          KDE - moving squares panel game
 i  kde-panel-worldwatch  3.0.7-3          KDE - worldclock panel applet
 i  kdeartwork3            3.0.7-3          KDE - additional artwork
 i  kdeedu3                3.0.7-3          KDE - educational software
 i  kdeedu3-shlibs        3.0.7-3          KDE - shared libraries used by kdeedu3 apps
 i  kdegames3              3.0.7-3          KDE - games
 i  kdegames3-common      3.0.7-3          KDE - shared libraries used by KDE games
 i  kdegraphics3          3.0.7-3          KDE - graphics
 i  kdenetwork3            3.0.7-3          KDE - networking
 i  kdenetwork3-common    3.0.7-3          KDE - shared libraries used by %N-shlibs
 i  kdenetwork3-misc      3.0.7-3          KDE - other miscellaneous network applications
 i  kdepasswd              3.0.7-3          KDE - password changer frontend
 i  kdessh                3.0.7-3          KDE - ssh frontend
 i  kdetoys3              3.0.7-3          KDE - Toys
 i  kdeutils3              3.0.7-3          KDE - Misc. utilities
 i  kdf                    3.0.7-3          KDE - disk space GUI
 i  kdvi                  3.0.7-3          KDE - DVI print file previewer
 i  kedit                  3.0.7-3          KDE - simple text editor
 i  keduca                3.0.7-3          KDE - create and revise form-based exams
 i  kenolaba              3.0.7-3          KDE - strategy board game
 i  kfax                  3.0.7-3          KDE - fax file viewer
 i  kfloppy                3.0.7-3          KDE - floppy disk formatter
 i  kformula              1.2.0-3          KDE - formula editor
 i  kfouleggs              3.0.7-3          KDE - PuyoPuyo clone
 i  kgeo                  3.0.7-3          KDE - interactive geometry
 i  kget                  3.0.7-3          KDE - download manager
 i  kghostview            3.0.7-3          KDE - postscript viewer
 i  khangman              3.0.7-3          KDE - hangman word game
 i  khexedit              3.0.7-3          KDE - hex editor
 i  kiconedit              3.0.7-3          KDE - icon editor
 i  kio-kmd                0.2-3            KIO module for running command-line utilities
 i  kit                    3.0.7-3          KDE - AIM chat client
 i  kiten                  3.0.7-3          KDE - Japanese reference and learning tool
 i  kivio                  1.2.0-3          KDE - flowchart program
 i  kjots                  3.0.7-3          KDE - small note taker
 i  kjumpingcube          3.0.7-3          KDE - tactical game
 i  klettres              3.0.7-3          KDE - multi-language alphabet learning aid
 i  klickety              3.0.7-3          KDE - tetris-like game
 i  klines                3.0.7-3          KDE - Color Lines-like logic game
 i  kmahjongg              3.0.7-3          KDE - pick-up game based on the ancient mandarin Mah Jong
 i  kmail                  3.0.7-3          KDE - mail client
 i  kmathtool              3.0.7-3          KDE - a collection of small math tools
 i  kmessedwords          3.0.7-3          KDE - mind-training word game
 i  kmines                3.0.7-3          KDE - minesweeper-like game
 i  kmoon                  3.0.7-3          KDE - moon phases
 i  kmplot                3.0.7-3          KDE - mathematical function plotter
 i  knewsticker            3.0.7-3          KDE - news ticker
 i  knode                  3.0.7-3          KDE - nntp news reader
 i  knorskverbs            3.0.7-3          KDE - learn Norwegian verb conjugation
 i  kodo                  3.0.7-3          KDE - desktop mileage odometer
 i  koffice                1.2.0-3          KDE - Office Suite
 i  koffice-common        1.2.0-3          KDE - files used by all of KOffice
 i  kolf                  3.0.7-3          KDE - mini-golf game
 i  konquest              3.0.7-3          KDE - multi-player strategic war game
 i  kontour                1.2.0-3          KDE - vector drawing program

Continue in the next post....

sao 11-22-2002 04:50 AM

Continued from above post...

Code:

i  korn                  3.0.7-3          KDE - new mail notification
 i  kpaint                3.0.7-3          KDE - graphic editor
 i  kpat                  3.0.7-3          KDE - collection of solitaire-like card games
 i  kpercentage            3.0.7-3          KDE - practice calculating percentages
 i  kpf                    3.0.7-3          KDE - personal fileserver
 i  kpoker                3.0.7-3          KDE - poker card game
 i  kpovmodeler            3.0.7-3          KDE - POV-Ray 3D modeler and composer
 i  kpresenter            1.2.0-3          KDE - PowerPoint-like presentation app
 i  krdc                  3.0.7-3          KDE - remote desktop client (VNC)
 i  kregexpeditor          3.0.7-3          KDE - regular expression editor kpart
 i  kreversi              3.0.7-3          KDE - reversi clone
 i  krfb                  3.0.7-3          KDE - remote desktop server (VNC)
 i  kruler                3.0.7-3          KDE - distance and color measurement
 i  ksame                  3.0.7-3          KDE - simple game inspired by SameGame
 i  kshisen                3.0.7-3          KDE - Shisen-So - a Mah Jong-like game
 i  ksim                  3.0.7-3          KDE - system monitor
 i  ksirc                  3.0.7-3          KDE - Internet Relay Chat client
 i  ksirtet                3.0.7-3          KDE - tetris clone
 i  ksmiletris            3.0.7-3          KDE - tetris clone
 i  ksnake                3.0.7-3          KDE - snake race played against the computer
 i  ksnapshot              3.0.7-3          KDE - screenshot utility
 i  ksokoban              3.0.7-3          KDE - sokoban-like game
 i  kspaceduel            3.0.7-3          KDE - 2-player space arcade game
 i  kspread                1.2.0-3          KDE - spreadsheet
 i  kstars                3.0.7-3          KDE - desktop planetarium
 i  ktalk                  3.0.7-3          KDE - UNIX chat client and server
 i  kteatime              3.0.7-3          KDE - tea timer
 i  ktimer                3.0.7-3          KDE - timer
 i  ktouch                3.0.7-3          KDE - touch-typing tutor
 i  ktron                  3.0.7-3          KDE - simple tron clone
 i  ktuberling            3.0.7-3          KDE - Mr. Potato Head-like game
 i  ktux                  3.0.7-3          KDE - tux-in-a-spaceship screensaver
 i  kugar                  1.2.0-3          KDE - business report viewer and creator
 i  kuickshow              3.0.7-3          KDE - slideshow application
 i  kverbos                3.0.7-3          KDE - spanish verb form study aid
 i  kview                  3.0.7-3          KDE - image viewer
 i  kvoctrain              3.0.7-3          KDE - vocabulary training tool
 i  kwikdisk              3.0.7-3          KDE - mount and unmount disks
 i  kwin4                  3.0.7-3          KDE - connect-4 clone
 i  kword                  1.2.0-3          KDE - word processoor
 i  kworldclock            3.0.7-3          KDE - international clock
 i  kworldclock-maps      3.0.7-3          KDE - extra maps for kworldclock
 i  kxmlrpcd              3.0.7-3          KDE - inter-process communcation server
 i  lisa                  3.0.7-3          KDE - network neighborhood browser
 i  lskat                  3.0.7-3          KDE - 2-player card game like Offiziersskat
 i  megami                3.0.7-3          KDE - blackjack card game
 i  mosfet-liquid          0.9.5-6          Mosfet's "liquid" style for KDE

And that's a lot of packages. :D

KDE was one of the first things I installed after upgrading Fink for 10.2
(Sorry the list was too long to put in just one post)

Cheers...

sao 11-22-2002 05:47 AM

And the same goes for Eterm in Jaguar:
Code:

i  aterm                  0.4.2-2          Afterstep XVT - a VT102 emulator
i  eterm                  0.9-1            Color VT102 terminal emulator
i  kterm                  6.2.0-2          X11terminal emulator that can handle multi-lingual text.
i  rxvt                  2.7.8-1          ouR XVT - a VT102 emulator for the X11


Cheers...

steve_rothman 11-22-2002 10:40 AM

Thanks everyone!!!!
 
I just want to say thanks to everyone!

Getting the Gnu version of sed did indeed solve my problem - it amazes me because the source for my one-liner is from 5 years ago, so it sounds to me like the version of sed included with Jaguar must be *really* old. Oh well.

More than dealing with sed, though, I have learned a lot from all the comments on this thread. Thanks a ton, everyone. -Steve

osxpez 11-22-2002 04:00 PM

steve: It doesn't have to be *very* old. It's just not GNU sed. Again, I'm surprised that Apple chooses not to go more fully GNU. And the choice of tcsh over bash or zsh is strange as well. It's like Apple has somehow grasped that Unix is powerful, but missed that GNU is the organisation that takes it to a fuller potential.

osxpez 11-22-2002 04:04 PM

Thanks for the info thatch and sao! I'll try just that when my "fink install 'gtk+'" finishes ... which could take quite some while it seems.

$ fink -V
Package manager version: 0.11.0
Distribution version: 0.4.9.cvs

osxpez 11-23-2002 02:40 AM

I did both "fink selfupdate-cvs" and "fink update-all" but I still can't eterm:

$ fink list '*eterm*'
Information about 769 packages read in 1 seconds.

I noticed on sao's output from fink that you had about 1,000 more packages... What am I doing wrong?

thatch 11-23-2002 03:39 AM

osxpez, did you use sudo for your self-update command? If so, something is not right because this is what I get:

Code:

fink list '*eterm*'
Information about 1774 packages read in 1 seconds.

    eterm            0.9-1        Color VT102 terminal emulator

You may have mentioned it earlier in this very long thread or elsewhere on the forum; but how did you install or upgrade your fink for Jaguar?

sao 11-23-2002 04:39 AM

osxpez,

You probably forgot to edit your fink.conf file:
Code:

Trees: local/main stable/main stable/crypto local/bootstrap unstable/main unstable/crypto
this step is highly recommended as most packages for 10.2 are in unstable. And after, run 'fink selfupdate-cvs' again.

Did you installed Fink from scratch from here?:

http://fink.sourceforge.net/news/jag-bootstrap.php

Maybe you show us the result of 'sudo fink list'


Cheers...

osxpez 11-23-2002 05:37 AM

sao: Thanks for beeing there! Yes, I installed Fink from scratch again using that URL. And I'm bloody sure I entered that "unstable" record into my fink.conf since the installation instructions told me to do so. But now when you suggested it again I had a check and it wasn't there. No wonder we have different "fink list" output. I'm running a "fink selfupdate-cvs" as of now and it surely seems to be working harder this time. :)

One more thing. You ask me if I used sudo for the fink update things. No, since fink seems to be using sudo itself (asking me for the password and all) I didn't think that was necessary.

sao 11-23-2002 09:15 AM

osxpez,

Great, after your 'fink selfupdate-cvs' finishes, your list of available packages to install from source will increase by a lot.

You are right about using 'fink selfupdate-cvs', fink will automatically do it for you, asking you for a password, even when you didn't write 'sudo'.


Cheers...

Titanium Man 11-24-2002 09:50 PM

Way off subject
 
Just to make everyone mad (or provide an alternate solution to using sed, perl, {g,m,a}wk):

% links -dump http://checkip.dyndns.org
Current IP Address: 12.34.56.789
Hostname: some.place.com

mervTormel 11-24-2002 10:18 PM

:mad: grrrrrrrrr!eat tip, TiMan!

osxpez 11-25-2002 03:21 AM

Yes, that could be the right tool for the job. But maybe a bit bloaty if you just want to strip the html tags from a file on local disk. You all probably know that life is entirely about saving CPU cycles? :)

sao 11-25-2002 03:38 AM

The beauty of the forums...I learn something new every day!

Now, we can all choose whatever way we need it.

Good tip, TiMan...!


Cheers...

Titanium Man 11-25-2002 10:39 AM

Well for local files, I do:

cat foo.html | links -dump | less

but with all that piping and evoking of cat, links, and less, it might be a bit too bloaty for everyone to use ;)

osxpez 11-25-2002 12:16 PM

UUOC watch dog - That should probably be:

links -dump < foo.html | less

mervTormel 11-25-2002 12:20 PM

i'm pretty sure this is a case of ĜUUOC...

$ links -dump < poop.html | less
URL expected after -dump

pez, don't make me come over there.

osxpez 11-25-2002 12:28 PM

Well, I don't have links installed, but that _must_ go for the "cat" version as well or links is a truly wierd program. What about:

$ links -dump bar.html | less

Depends some of what links regards as an URL.

Titanium Man 11-25-2002 09:37 PM

It's not the processor cycles, but the typing that gets to me.

links -dump bar.html | less

not only works bit there is less typing than with my original siggestion. Thanks!

thatch 11-25-2002 11:26 PM

Great thread!
 
This one might deserve a rating it's so good, and even if you don't use links. Very educational.

BTW, I didn't realize that I didn't need sudo when doing a fink install. It's always been a habit while installing with fink for me.

kudos to that movie from Paul for it's demonstration of 'size really does matter'; at least in that instance the chainsaw won hands down, literally.

mervTormel 11-26-2002 02:24 AM

Re: Great thread!
 
Quote:

Originally posted by thatch
...kudos to that movie from Paul for it's demonstration of 'size really does matter'; at least in that instance the chainsaw won hands down, literally.
dialog matters, too...

http://home.mindspring.com/~bduart/tobor.mov [ thanks, henry ]

thatch 11-26-2002 03:00 AM

Quote:

Originally posted by mervTormel
dialog matters, too...
Yes, definitely. An important point of this thread.

I like the movie. Strange though, I can't seem to save it with the 'save as' in IE. It complains that it can't save because the disk may be too full. My drive is only 41% full. There are currently no other movies in my ~/Movies.

With Paul's movie earlier today, I saved it and it played in a finder window from column view. But when I tried to play it again later on, it complained it couldn't find some certain file with a strange name consisting of numbers and letters, I think.

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.