Skip to main content

Questions tagged [ed]

For questions about the editor ed, a scriptable line-oriented text editor, originally written by Ken Thompson for the Multics and Unix operating systems. Use this tag for questions about ed itself or questions about issues arising from using the ed editor.

1 vote
1 answer
122 views

Consider the following commands: $ awk 'BEGIN { system("ed") }' q $ echo hello | awk 'BEGIN { system("ed") }' ? $ In the first case, I was able run ed and then stay in the editor ...
mbigras's user avatar
  • 3,512
1 vote
1 answer
103 views

I sourced the /usr/share/doc/fzf/examples/key-bindings.bash file so fzf works in Bash; but how do you get that to work with the rlwrap ed approach?
mbigras's user avatar
  • 3,512
1 vote
1 answer
57 views

Consider a file with an AsciiDoc ordered list like this: . one + ---- echo hello # arbitrary lines... echo world ---- . two . three How do you move the code block to some arbitrary place in the list (...
mbigras's user avatar
  • 3,512
1 vote
1 answer
93 views

On my macOS and Linux systems, I run ed with alias ed='rlwrap ed'. On macOS with rlwrap 0.46.1 (2022) I can freely create files with tabs like: $ ed a foo<TAB>bar but on my Linux systems with ...
mbigras's user avatar
  • 3,512
5 votes
3 answers
194 views

Given the following file: foo bar baz this and that then I can easily "unfold" those lines with global substitution with ed(1): g/ /s//\ /g which gives: foo bar baz this and that But what'...
mbigras's user avatar
  • 3,512
1 vote
1 answer
281 views

I am running GNU Ed on Fedora Linux. The GNU Ed manual cryptically refers to an 'r' suffix for the s command, to be distinguished from the 'r' command. All it says about it is the following: The ...
edman's user avatar
  • 598
3 votes
1 answer
175 views

In Ed I can test for whitespace with this regex: g/ *$/p. I don't suppose there is a way of showing whitespace, perhaps by passing the contents of the buffer to another shell command?
edman's user avatar
  • 598
1 vote
2 answers
123 views

Is there a way to have ed create backups of the file currently loaded into the buffer. On occasion I have inadvertently overwritten my file and found it's not recoverable. I.e. making a backup file ...
edman's user avatar
  • 598
0 votes
3 answers
123 views

Consider my humble hello.html file, edited with mighty ed: $ ed hello.html 28 ,p <title>Hello world!</title> What's your general approach to edit inside that title HTML tag (bonus if you ...
mbigras's user avatar
  • 3,512
6 votes
1 answer
352 views

I'm totally mystified why I can't print this range with ed when there are two ranges—see file2.tf file—; but I can print when there is only one range—see file1.tf file—and I can print with the gsed (...
mbigras's user avatar
  • 3,512
1 vote
4 answers
139 views

I have a file with permissions 666 so users can edit it with a different script. This works. I need to script to remove the last line of the file, however this is not working as using something like ...
Dave's user avatar
  • 732
1 vote
2 answers
234 views

I'm looking for a way to edit files with a script that will provide an alternate definition for a variable in C and this redefinition is controlled by a compiler D-flag using a POSIX application that ...
Pillager225's user avatar
2 votes
1 answer
220 views

I am running GNU ed 1.18 on Fedora Linux 36. I run ed with rlwrap also installed which gives me access to my command history. My .ed_history file appears to have a size limit of 300 lines. I would ...
edman's user avatar
  • 598
0 votes
1 answer
944 views

In ed there is the useful c command which allows one to make changes to a specific line. (Using rlwrap as well allows for easier changes, once a line has already been changed, because one can use the ...
edman's user avatar
  • 598
3 votes
3 answers
1k views

I want to create a sed command that will remove all of these strange characters from a given document: sed -n 's/\|®MD-IT¯\|®MD\+BO¯\|®MDNM¯®LL\.8LI,0LI¯\|®LL0LI,0LI¯\|®MD\+IT¯\|®LL.8LI,0LI¯®MDIT¯\|®...
edman's user avatar
  • 598

15 30 50 per page
1
2 3 4 5 6