Regex in zos_lineinfile #907
-
Hi guys! I have the following entry in a PDS member: //* 06/24/2021 D160882 - Creation V560 I'm using the zos_lineinfile module to find and delete the string D160882. When I put exactly that string in the regex parameter, it finds and deletes the line as requested: zos_lineinfile: However, when I actually try to use a regular expression to find a string that starts with a letter and is followed by 6 numbers, it doesn't. zos_lineinfile: This is the message when it does not find: Could someone help me please? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @fabiobncbb , which version of the ibm_zos_core collection are you using and which version of zoau so I may try to reproduce. |
Beta Was this translation helpful? Give feedback.
-
I tried this on the supported ZOAU 1.2.2 and ibm_zos_core version 1.6.0 and found that there is a bug in our dependency, thus I have opened a bug with them and noted this is a community reported issue #913 , please follow the issue The are some work arounds I can think of:
I will create an issue tomorrow and report it back here, below is my playbook recreate. My recreate is:
|
Beta Was this translation helpful? Give feedback.
I tried this on the supported ZOAU 1.2.2 and ibm_zos_core version 1.6.0 and found that there is a bug in our dependency, thus I have opened a bug with them and noted this is a community reported issue #913 , please follow the issue
913
for resolution. I am provide some work around below, I am happy to discuss them further but for now it seems we can consider this mitigated and close the issue.The are some work arounds I can think of:
zos_copy
and copy the content to USS, tag it (*chtag) as UTF-8 and then use the community
blockinfileor
shellmodule to run
sedor
awkcommands from USS, then
zos_copy` the data back to the data set.zos_encode
to encode the data set to USS as UTF8, then u…