|
Posted by WCB on 06/20/05 02:23
Lauri Raittila wrote:
> in alt.html, WCB wrote:
>> Lauri Raittila wrote:
>>
>> > in alt.html, wcb wrote:
>> >> I am using Linux and Bluefish.
>> >> I have a lot of long documents I want html-ize.
>> >
>> > Learn perl.
>> >
>> >> I am looking for some sort of little Linux utility
>> >> where I could insert <br>'s into an existing file.
>> >
>> >> Is there such a quick and dirty beastie for Linux?
>> >
>> > sed
>> > man sed
>> >
>> >> Most utilities I see seem to be for Windows.
>> >
>> > Because nobody needs any *extra* utilies for something that simple in
>> > linux... there is some other tool as well, even more simple, but I
>> > don't recall what it is called...
>> >
>> >> I am looking for something that can do batch
>> >> processing if possible, doing an entire folder
>> >> at one shot.
>> >
>> > sed -i 's/$/<br>/g;' *.html
>> > (if I got it right...)
>>
>> But it still lacks recursive abilities.
>> I played with SED a bit. It still seems
>> to need a script to walk a tree.
>
> man find
>
> sed -i 's/$/<br>/g;' `find . -type f -iname \*.html`
> or
> find . -type f -iname \*.html -exec sed -i 's/$/<br>/g;' {} \;
>
> Quite likely I got em wrong...
>
>> I need to figure this out for the present
>> directory, all subdirecties, and all
>> files in them.
>
> Which you of course didn'tm mention orginally.
>
I had hoped that would have been obvious.
One does not want to have to walk through hundreds
of subdirectories by hand.
I had thought somewhere on the web, I could find a repository of
the simple and general atomic, basic bits and pieces to get these
sorts of scripts written and working without having to reinvent
the wheel.
Amazing there is not. I can find bash or perl scripts to
create entire websites or create front ends for MySQL.
Nothing at all for a very basic walk a directory script.
Why does stuff like this always have to be so hard and time
consuming?
Its like, get this big thick book, study it a few weeks and
start reinventing all those useful little wheels.
Why, you have nothing but time for that right?
Welcome to the Linux/Unix world. We've all been doing it
the hard way for 35 years and we aren't going to stop now.
Perl is even worse.
--
When I shake my killfile I can hear them buzzing.
Navigation:
[Reply to this message]
|