× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Arnie,

Am 12.10.2020 um 07:32 schrieb Arnie Flangehead <arnie.flangehead@xxxxxxxxx>:

But I've been knocking my brains out trying to figure out the syntax for
insert. The examples and tutorials I've pored through don't work in QSHELL.
There's not much point in my giving you what doesn't work because I've
tried hundreds of combinations. The manual is completely useless - no
examples at all.

If I have:

ONE IS NICE
THREE IS NICEST

I want to be able to insert the text TWO IS NICER between those two. Should
be simple, but I'm utterly defeated.

First, do you provide the pattern inline (on the command line) or with -f and an input pattern file? Different implementations of sed are *very* picky about the embedded escaped newline.

On IBM i 7.2, I tested. First, edtf 'infile.txt', content your two lines from above. Save, exit. Second, edtf 'sedscript', content:

/^THREE IS NICEST$/i \
TWO IS NICER

Save, exit. Run:

sed -f sedscript < infile.txt

Works on Debian Linux 10, works on IBM i 7.2, does *not* work on OS/400 V4R5. But this might be a locale problem, the error message "sed: 1: sedscript: command i expects Ö followed by text" hints to sed seeing an Ö instead of a \.

:wq! PoC

PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.