WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: ed missing from core.gz  (Read 6169 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
ed missing from core.gz
« on: August 07, 2019, 10:28:59 PM »
I know I'm going to sound like a dinosaur for saying this, but here goes:

It would be nice if ed text editor were part of TC base. Even though it is as old as dirt, ed can (amazingly) still be quite useful as a script-controlled text editor for batch editing text files.

Seeing that ed is one of busybox's applets (see https://git.busybox.net/busybox/tree/editors/ed.c), it is all the more surprising that ed is missing. Anyone know how/why the ed applet is missing from the busybox in TC 10.1?

It was trivial for me to fetch a binary from elsewhere since ed only depends on libc, but it would be nicer if it were part of the base system. Maybe in a future TC release?


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: ed missing from core.gz
« Reply #1 on: August 07, 2019, 10:43:35 PM »
Hi GNUser
... ed can (amazingly) still be quite useful as a script-controlled text editor for batch editing text files. ...
I thought that's what  sed  is used for.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: ed missing from core.gz
« Reply #2 on: August 08, 2019, 03:05:42 AM »
Our busybox config isn't "all-in", but tries to save space by only including commonly used things. The ed editor is quite rarely used nowadays.
The only barriers that can stop you are the ones you create yourself.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: ed missing from core.gz
« Reply #3 on: August 08, 2019, 04:24:38 AM »
GNUser - you aren't a dinosaur, but just a bit different like me, who also uses ed.

I also use bc / dc and personally, I just dig the whole busybox thing.

I've done what you have, and for quickies, just grabbed binaries from busybox, or better yet, compiled the very latest whole hog, and installed them into my existing tinycore setup - making a "BB" directory, and putting it in the front of my path.

https://www.busybox.net/FAQ.html#getting_started

To keep things straight though, I rename the busybox binary to busybox<ver>, and make softlinks to that.

I also make sure that if something funky does come up, I take BB out of my path so as not to file false bug reports in TC itself.

Personally, I'd love to see perhaps a "bb-core", which stays up with the very latest busybox in it's entirety for most everything as far as it can - even with the latest "unstable" busybox releases.  I suppose that would be a cool project, but I can never find a round-tuit to get off my butt. :)
That's a UNIX book! - cool  -- Garth

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: ed missing from core.gz
« Reply #4 on: August 08, 2019, 07:55:40 AM »
Our busybox config isn't "all-in", but tries to save space by only including commonly used things.
That makes sense. Nevertheless, both for history's sake (long tradition of being present in every *nix box) and for the fact that--with minimal familiarity--ed is much more flexible than sed*, my vote is to spare the 40 kiB or so and include it in base system.

* FWIW here is an example of the kind of real-world problem that sed or awk would overcomplicate, but ed trivializes:
https://jvns.ca/blog/2018/05/11/batch-editing-files-with-ed/
« Last Edit: August 08, 2019, 08:25:57 AM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: ed missing from core.gz
« Reply #5 on: August 08, 2019, 07:58:45 AM »
I just dig the whole busybox thing...compiled the very latest whole hog, and installed them into my existing tinycore setup - making a "BB" directory, and putting it in the front of my path.

Excellent idea!

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: ed missing from core.gz
« Reply #6 on: August 16, 2019, 08:10:22 PM »
A passionate plea to put ed into the standard busybox for TC:

Many distros today, not just TC, lack the ed editor.  To me, that is a slight dishonor to those who initially forged the ideas of what we are using now, even though the amount of actual users may be slight.

From a more historical standpoint that has oft been repeated:

http://www.columbia.edu/~rh120/ch106.x09

So ed and pipes.  Still a pain from a toolbox standpoint.  Along comes grep, pulled out from ed.  How about some more, like gres and a long line of others pulled from ed?  To get that desire under control comes sed.

You kind of see where I'm going with this.  Ed and it's followups were part and parcel of the birth of the toolbox concept, which later begat PWB and sccs and so on...

Since TinyCore espouses the toolbox-concept itself in a big way, I'd like to see ed back in the distro as a badge of honor and respect - even if just a simpler facsimilie with busybox' version.
« Last Edit: August 16, 2019, 08:14:48 PM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: ed missing from core.gz
« Reply #7 on: August 16, 2019, 08:45:20 PM »
Hi PDP-8
A number of years ago a request for  busybox httpd  was made and denied for the same reason. So someone made a
busybox-httpd  extension instead:
Code: [Select]
Title: busybox-httpd.tcz
Description: BusyBox HTTP server
Version: 1.21.1
Author: BusyBox is maintained by Denys Vlasenko
Original-site: http://www.busybox.net/downloads/busybox-1.17.2.tar.gz
Copying-policy: GPLv2
Size: 20 KB
Extension_by: PingPing, ixbrian, Curaga
Tags: BusyBox HTTP server
Comments: Busybox's httpd applet.
Files installed:
/usr/local/httpd/bin/busybox
/usr/local/httpd/bin/false (symlink)
/usr/local/httpd/sbin/httpd (symlink)
False has been built but is not strictly needed - it comes in handy if chrooting httpd
To start:
sudo /usr/local/httpd/sbin/httpd -p port_number -h document_home_directory -u user:group
Where:
port_number is the port for httpd to listen on (default is 80)
document_home_directory is the directory containing your index.html (you'll need to make one)
user is the user you want httpd to run as eg. 'tc' (default is root)
group is the group 'user' is a member of eg. 'staff'
For example:
sudo /usr/local/httpd/sbin/httpd -p 80 -h /home/tc/htdocs -u tc:staff
Change-log: 2009/07/01 - original build
2010/08/31 - Updated to busybox 1.17.2
Current: 2013/08/10 - Update to 1.21.1 (Curaga)
There's a build script here if you want to try a similar approach for  ed:
http://tinycorelinux.net/4.x/x86/tcz/src/busybox-httpd/

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: ed missing from core.gz
« Reply #8 on: August 16, 2019, 11:23:22 PM »
Thanks for the link to the buildscript.

But it's not a technical issue really (I've got ed installed just by doing my own busybox).  I do think that ed might be a tad smaller than httpd though. :)

Not a deal breaker...
That's a UNIX book! - cool  -- Garth

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: ed missing from core.gz
« Reply #9 on: August 17, 2019, 12:15:43 AM »
I’ve never seen the need to use ed, however there’s nothing to prevent anyone from compiling the full gnu version, create and submit an ed extension

https://www.gnu.org/software/ed/




Sent from my iPhone using Tapatalk

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: ed missing from core.gz
« Reply #10 on: August 30, 2019, 03:30:45 PM »
I completely agree with PDP-8. It is trivial to obtain ed, so that's not the issue... There is no question that TinyCore embraces the UNIX philosophy (in spades). So why not include ed in base (Busybox version would suffice) as a token of respect to UNIX history? The increase in size of core.gz would not even be noticeable--in would be on the scale of a rounding error.

Having said that, I'd be happy to submit GNU ed as an extension (for those who want more than the miniature Busybox version). However, I've submitted over 10 extensions for Pure64 in the last month and got no feedback. As soon as I get some indication that the submissions are not falling into a black hole, I'll be (quite) happy to submit GNU ed ;D
« Last Edit: August 30, 2019, 03:35:55 PM by GNUser »

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: ed missing from core.gz
« Reply #11 on: December 10, 2019, 01:48:23 AM »
GNUser - saw your ed submission in the repos - thanks for that man!
That's a UNIX book! - cool  -- Garth