Recent

Author Topic: Shell text editor  (Read 3742 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Shell text editor
« on: December 03, 2017, 04:50:42 pm »
hi All,
in headless Linux systems i would need to:

a. create and very basic edit of text file (midnight commander editor level or even less)
b. save file (preferably control + s)
c. run a shell command on this file (with shortcut, user does not exit the app)
d. present output of the shell command in a section of the app screen
e. exit app

please advise if there is some code i could reuse at least from the DOS era.
thank you
« Last Edit: December 03, 2017, 05:03:08 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Shell text editor
« Reply #1 on: December 03, 2017, 06:14:31 pm »
Implementing edlin comes to mind.

Your system does not come with a text-editor like nano.
(Yes, to all others: please say vi(m)).

Bart

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: Shell text editor
« Reply #2 on: December 03, 2017, 06:28:59 pm »
thank you!

i found this link on edlin: http://www.delphigroups.info/2/57/3289.html
system comes with vi but i would like to run a TProcess and present the output in the same screen area (draw a temporary line or something).
Lazarus 2.0.2 64b on Debian LXDE 10

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Shell text editor
« Reply #3 on: December 03, 2017, 10:16:56 pm »
Real programmers use edlin.
Even better programmers use copy con program.pas  O:-)

Bart

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: Shell text editor
« Reply #4 on: December 04, 2017, 12:00:25 am »
and most of those programmers of those days have one foot in the grave..

 :D
The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 14381
  • Sensorship about opinions does not belong here.
Re: Shell text editor
« Reply #5 on: December 10, 2017, 05:32:00 pm »
"Copy con" is a very good test during job interviews....
Anyway, consider Nano.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018