a bash riddle - for you [solved]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#16 Post by zigbert »

sed -f "/path/html_numbers"
Attachments
html_numbers.gz
(787 Bytes) Downloaded 232 times

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#17 Post by zigbert »

akash_rawal
I tested your elegant solution, but it seems to work only in terminal. - Not in the Pmusic gui which only supports UTF-8.


Sigmund

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

html decoding

#18 Post by vovchik »

Dear Zigbert,

Of all the solutions posted, Dougal's sed version seems to be the fastest. I had no problems getting the text into a GTK gui when I used printf (my little mod to akash's version). It is also pretty fast - and has no external dependencies. Dougal's external sed file could be incorporated into your own script, obviating the need to read an external file read and making it even faster!

WIth kind regards,
vovchik

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#19 Post by technosaurus »

My guess is that zigbert's intention is to use it to display lyrics in a gtkdialog from a.website?
I never cease to be amazed by sed.

BTW, the reason I used a single call to httpd vs sed was because I couldn't come up with a way to do a single call to sed (sed and httpd aren't nofork/noexec applets in busybox) ... busybox builds are a whole lot faster than bash with the prefer applets and nofork/noexec options enabled (most distros just disable it rather than fix the scripts that it breaks, not that I blame them, its always harder to read code than write it) if you use bash vs ash as /bin/sh then my script is 5x slower, probably more if you have the full httpd.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: echo/printf

#20 Post by Dougal »

vovchik wrote:I am not sure that it is bash 4.2 that causes this, but I am otherwise at a loss to explain why I get no results with echo -ne - just some blank lines.
I doubt it is bash itself, or the internet would have a lot of noise about it... you could try \echo to see if the external echo works.
Was the new bash compiled with a different kernel? At some stage I started having problems with the builtin sleep not working for me in rc.shutdown... using \sleep fixed it, but I still don't know why it broke.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

Bruce B

#21 Post by Bruce B »

I started on following this topic, then decided to cheat.

lynx -dump -nonumbers "$@"

~

Post Reply