Skip to content

RM5248

We don't fix problems, we make them worse!

Menu
  • Cross-compile QT for ARM
  • D-Bus Tutorial
  • Debian Packaging Tutorial
Menu

Editing a file with no tools

Posted on August 21, 2012

So I came across this interesting question on SuperUser yesterday, and it got me thinking… would it be possible to create a full text editor using only standard terminal commands?  That is, could we create a text editor using only standard tools such as shell scripts, sed, awk, grep, etc.  That way it could be completely portable, and not depend on any binaries on the target system.  The only binaries which would be required would be for the standard tools – which should already be installed.

Anyway, that would be cool.

2 thoughts on “Editing a file with no tools”

  1. Tim says:
    January 21, 2013 at 7:53 pm

    $ whatis ed
    red (1) – line-oriented text editor
    ed (1) – line-oriented text editor
    $ whatis sed
    sed (1) – stream editor for filtering and transforming text

    Assuming you have at least sed, you can do anything you need. Looking at the SuperUser question, that system was very very limited, and the best option was to move the file to another system, edit, and move it back. (You can use ssh to cat a file out, and cat a file in very easily)
    Most people know how to use sed to perform a regex. It can do much much more, so you should learn it.

    Reply
    1. rm5248 says:
      January 22, 2013 at 11:07 am

      True, sed/ed would work. I was thinking more along the lines of vi though, as only editing a file in terms of lines could get very tedious.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

©2023 RM5248 | Design: Newspaperly WordPress Theme