Search Results

Search: Posts Made By: RudiC
5,837
Posted By RudiC
Didn't you say you're doing a step by step debug?...
Didn't you say you're doing a step by step debug?
Try

sed "s/\(JUL\)/XXX/" fileRead your sed version's man page!
5,837
Posted By RudiC
You're missing a / at the end of your s ...
You're missing a / at the end of your s command:


/home/oracle/>/usr/xpg4/bin/sed "s/\(JUN\|JUL\|AUG\)/$NEWDATE/" test4.txt
5,837
Posted By RudiC
You'll have to debug stepwise. What be the result...
You'll have to debug stepwise. What be the result of

sed "s/\(JUN\|JUL\|AUG\)/XXXX/" file?
And yes, try /usr/xpg4/bin/sed (NOT bib !).
5,837
Posted By RudiC
Does your OS provide other sed versions? ...
Does your OS provide other sed versions?



For debugging, try to restrict yourself to match the months only. You may want to apply vgersh99's proposal as well to get rid of the {2}.
5,837
Posted By RudiC
OK, then, try to write the months verbatim...
OK, then, try to write the months verbatim explicitly and escape parentheses, pipes, and braces:
sed "s/[0-3][0-9]-\(JUN\|JUL\|AUG\)-[12][09][0-9]\{2\}/$NEWDATE/" file
5,837
Posted By RudiC
How specific the date regex has to be? Is it OK...
How specific the date regex has to be? Is it OK to match 31-FEB? Any condidtions for the year, e.g. only 20xx, or 19xx as well? Does your sed handle EREs? Try
NEWDATE=01-OCT-2019
sed -r...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 05:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy