Welcome, Guest. Please login or register.

Author Topic: Has anybody used the "Edit" shell command in recent years, and/or knows what it does?  (Read 4383 times)

Description:

0 Members and 1 Guest are viewing this topic.

guest11527

  • Guest
Re: Has anybody used the "Edit" shell command in recent years, and/or knows what it d
« Reply #14 from previous page: April 01, 2016, 02:59:00 PM »
Quote from: kolla;806643
In my view, sed and edit are different beasts - sed is a "stream editor", working on data streams, while edit is more like a normal editor, except you are pretty much editing blindly. The UNIX equivalent of Amiga "edit" would be "ed".

"edit" can certainly be run in non-interactive mode by proper redirection, and as far as I understand, that's the intended purpose. Otherwise, the "user interface" is pretty much a joke.

Except that it is too limited to be really useful. It's one of the left-overs from original tripos. Get "SED" from the aminet, does its job and is more powerful.
 

Offline Linde

  • Sr. Member
  • ****
  • Join Date: Mar 2004
  • Posts: 457
    • Show only replies by Linde
    • http://hata.zor.org/
The names always seemed a bit mixed up to me -- "ed" is more vi-like and "edit" is more ed-like. I never learned how to use "edit" but it seems pretty nice as far as line-wise interactive editors go, with things like "insert after". OK, my only reference is Unix ed, the STANDARD Unix editor...
 

Offline Gulliver

@olsen

Thank you for the insight on the current buggy status of the AmigaOS 3.x implementation of Edit.
I will definately stay away from the read function.

Is it possible by any chance, that you build a fix for 3.1 and/or 3.9 users that just addresess the most dangerous bugs it has? You could probably release it as a spatch file without issues.

The BCPL heritage in AmigaOS seems to be just a troublemaker everywhere it went :)
 

Offline pyrre

Quote from: Thomas Richter;806590
Well, the purpose of EDIT is rather to automate edits for scripting, and for that CED is not well suited. EDIT could, in principle, do this. However, it's arcane syntax is not really helpful.  I personally use my edition of SED for this purpose - the syntax is probably not less arcane, though based on the AmigaDos wildcards, but at least the beast works.
i am not in any way a programmer. i never use scripts, and automating scripts.. way over my head.
i preferd CED for editing startup-sequence or user startup, or anything related.
Amiga 1200 Tower Os 3.9
BPPC 603e+ 040-25/200, 256MBram, BVIsionPPC, Indivision AGA MK2.
Amiga 2000 (rev 4.0) Os 1.2/1.3
2088 bridgeboard, 2MB ram card, 2091 SCSI.
Amiga 500+ Os 2.1
Derringer 030, 32MBram, Buddha in sidecar, Indivision ECS.
Amiga CD32
Video decoder
 

Offline chris

Quote from: Linde;806674
"ed" is more vi-like


A really really really user-friendly version of vi, maybe.

I can see the similarities but vi is horrid with unmemorisable strings of commands to insert lines or delete characters.  Ed does have such commands, but basic editing is possible without them, and any commands you might need are helpfully available from the menu.

I'll happily use Ed, but will avoid vi like the plague.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline kolla

And I use vim for just about everything, every day :)
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline olsenTopic starter

Quote from: Gulliver;806693
@olsen

Thank you for the insight on the current buggy status of the AmigaOS 3.x implementation of Edit.
I will definately stay away from the read function.

Is it possible by any chance, that you build a fix for 3.1 and/or 3.9 users that just addresess the most dangerous bugs it has? You could probably release it as a spatch file without issues.
It could happen. Much of the rework that went into making AmigaOS4 never was available to 68k AmigaOS users. There's a whole lot of interesting and useful stuff which, with little changes, could be released as part of an updated Workbench 3.10 or something like it.

Quote
The BCPL heritage in AmigaOS seems to be just a troublemaker everywhere it went :)
Well, it occasionally makes for good late night entertainment. The original "Edit" BCPL version, which I used as a reference to (sort) figure out if the problems were with the port or the original code, is one big lump of code. 47 KBytes of BCPL goodness with very few documentation comments to show you how it works or why it works.

One implementation detail which puzzled me was eventually cleared up after finding a description of the BCPL language and its operators. Apparently, BCPL has no modulus operator ('C' uses '%'), so the author of "Edit" needed to find a different solution which was more elaborate than it might have been in 'C', for example.
« Last Edit: April 03, 2016, 10:26:50 AM by olsen »
 

Offline Linde

  • Sr. Member
  • ****
  • Join Date: Mar 2004
  • Posts: 457
    • Show only replies by Linde
    • http://hata.zor.org/
Quote from: chris;806703
A really really really user-friendly version of vi, maybe.

I can see the similarities but vi is horrid with unmemorisable strings of commands to insert lines or delete characters.  Ed does have such commands, but basic editing is possible without them, and any commands you might need are helpfully available from the menu.

I'll happily use Ed, but will avoid vi like the plague.


Each to their own, I guess. For me, since my job involves writing and changing many lines of text, the investment in learning the basics of vi and vim is a small one. To get to the point where you've covered all the ed editing features, you need to learn maybe 10-15 commands only superficially, and then you can get into the details that make editing in vi quicker in the long run, like marks, motions, regular expressions and auto indentation.