Re: Editor Documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Jay Crews wrote:
Wolfgang Gill writes....

Thanks for that, it was EXACTLY was I was looking for. I'd also assume that
these commands and functions can be used in scripting?? Without any trouble?


Well......not exactly.  Or not really for writing scripts
like I think you are talking about.

Not sure what he's after either. For simple editin in the middle of a larger script, ed is a fine tool though.


However, you will see similarities in some of the commands
and tools like 'sed.'  I think it has something to do with 'ed'
commands, which vi is a frontend, or something........Someone
with more history info can probably explain better.

Why does vi keep comming up? He asked for help with ed.


OK, OK, I know. vi is really a full screen verion of ex.
ex and ed are line based editors (you work on one line at a time)
but there are many differenceds, enough that they arent interchangable.
ed only uses single letter commands, ex has long names as well. ex commands are more like vi (understandable since they are basicly the same program) than ed, so if you know vi, ex migh be better for you.
ex also offers some enhancements that ed doesn't have.


But if you are starting out today, and want to write some scripts,
you will do yourself well to learn Perl.

Learning perl is a very good idea. You can never know too many languages. Help pick the best one for a given task.


can do, and you can learn Perl in about the same time as learning
both sed and awk.  PLUS, anything you cannot do with a Perl
command, you can invoke a shell command and pull the results back
into Perl to process.  AND.....Perl makes string parsing a piece
of cake, whereas it's a NIGHTMARE doing much of it with just regular
unix commands piped together.
And Perl is VERY portable, and here to stay.


It really depend on what he's wanting to do. The original question sounded like ed world be fine, or sed might be good to, depends on weather you need to jump aroung in the file. sed (and perl) are designed for sequential, start to finish work. ed for jumping around with random edits.

-Thomas



--
Psyche-list mailing list
Psyche-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux