And for some reason I seem to remember having CCSID issues doing replacements like this. I have this mess in one of my programs to work around that.
RMVLNK OBJLNK('/temp/mds30gl.work')
MONMSG MSGID(CPF0000)
RMVLNK OBJLNK('/temp/mds30gl.work1')
MONMSG MSGID(CPF0000)
CHGVAR VAR(&FILE2) VALUE('/temp/mds30gl.work1')
CPY OBJ(&FILE) TOOBJ('/temp/mds30gl.work1') +
FROMCCSID(37) TOCCSID(819) DTAFMT(*TEXT) +
REPLACE(*YES)
STRQSH CMD('/usr/bin/touch -C 819 /temp/mds30gl.work')
CHGVAR VAR(&CMD) VALUE('sed -e ''s/\" \"//g'' ' +
*BCAT &FILE2 *BCAT '| sed -e +
''s/,\./,0\./g'' | tr -d ''\r'' > +
/temp/mds30gl.work')
STRQSH CMD(&CMD)
RMVLNK OBJLNK(&FILE)
MOV OBJ('/temp/mds30gl.work') TOOBJ(&FILE)
On Fri, 2020-11-13 at 21:50 +0000, Kevin Bucknum wrote:
True, but with IP address's I've never seen a miss match when doing whole host entries. Unless there was something already messed up, you can't hit anything else.
But the real issue in this case is exactly what the message says. He didn't finish the expression. Need either another / or /g.
s/x.x.x.x/y.y.y.y/
or
s/x.x.x.x/y.y.y.y/g
On Fri, 2020-11-13 at 15:45 -0600, Chris Pando wrote:
The dot is a wild card character. I'm super cautious, so I'd either
backlash it or put it in brackets if I want to match a literal '.' .
On Fri, Nov 13, 2020, 3:21 PM Kevin Bucknum <
<mailto:
<mailto:Kevin@xxxxxxxxxxxxxxxxxxx>
Kevin@xxxxxxxxxxxxxxxxxxx
<mailto:Kevin@xxxxxxxxxxxxxxxxxxx>
Kevin@xxxxxxxxxxxxxxxxxxx
wrote:
Don't escape the periods.
On Fri, 2020-11-13 at 21:10 +0000, Dean Eshleman wrote:
Hi,
I'm trying to use sed to find and replace an IP address in a Apache config
file as part of switching over to our DR machine. I want to script the
process rather than doing it manually. I need to replace 10.2.0.109 with
10.202.0.109. Here is what I have tried based on examples I found online.
Since there are periods involved in the string, I thought I needed to
escape them.
STRQSH CMD('sed "s/10\.2\.0\.109/10\.202\.0\.109"
/home/jdeane/http_dr.conf > /home/jdeane/http_dr.conf')
When I run this, I receive an error "there is an incomplete substitution
in a regular expression". Anyone have any ideas?
Dean Eshleman
Software Development Architect
Everence
1110 North Main Street
PO Box 483
Goshen, IN 46527
(800) 348-7468 ext. 3528
(574) 533-9515 ext. 3528
[Join our Talent Network]<
<
<
<
http://www.everence.com/careers>
http://www.everence.com/careers
<
http://www.everence.com/careers>
http://www.everence.com/careers
<
<
http://www.everence.com/careers>
http://www.everence.com/careers
<
http://www.everence.com/careers>
http://www.everence.com/careers
Confidentiality Notice: This information is intended only for the
individual or entity named. If you are not the intended recipient, do not
use or disclose this information. If you received this e-mail in error,
please delete or otherwise destroy it and contact us at (800) 348-7468 so
we can take steps to avoid such transmission errors in the future. Thank
you.
[
<
<
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp>
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp
<
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp>
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp
] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
<
<
https://www.medtronsoftware.com>
https://www.medtronsoftware.com
<
https://www.medtronsoftware.com>
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain
confidential information, belonging to the sender that is legally
privileged. This information is intended only for the use of the
individual or entity named above. The authorized recipient of this
information is prohibited from disclosing this information to any other
party and is required to destroy the information after its stated need has
been fulfilled. If you are not the intended recipient, or the employee of
agent responsible to deliver it to the intended recipient, you are hereby
notified that any disclosure, copying, distribution or action taken in
reliance on the contents of these documents is STRICTLY PROHIBITED. If you
have received this email in error, please notify the sender immediately to
arrange for return or destruction of these documents.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email:
<mailto:
<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
MIDRANGE-L@xxxxxxxxxxxxxxxxxx
<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
<
<
https://lists.midrange.com/mailman/listinfo/midrange-l>
https://lists.midrange.com/mailman/listinfo/midrange-l
<
https://lists.midrange.com/mailman/listinfo/midrange-l>
https://lists.midrange.com/mailman/listinfo/midrange-l
or email:
<mailto:
<mailto:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
<mailto:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
<
<
https://archive.midrange.com/midrange-l>
https://archive.midrange.com/midrange-l
<
https://archive.midrange.com/midrange-l>
https://archive.midrange.com/midrange-l
.
Please contact
<mailto:
<mailto:support@xxxxxxxxxxxxxxxxxxxx>
support@xxxxxxxxxxxxxxxxxxxx
<mailto:support@xxxxxxxxxxxxxxxxxxxx>
support@xxxxxxxxxxxxxxxxxxxx
for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
<
<
https://amazon.midrange.com>
https://amazon.midrange.com
<
https://amazon.midrange.com>
https://amazon.midrange.com
[
<
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp>
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp
] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
<
https://www.medtronsoftware.com>
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.