Bug in __block type: cannot have to blocks with similar prefix #200
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#200
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: telmich
Having those two blocks:
firewall_ip_web
firewall_ip_web_dmz
only the first block is created - I guess the problem is we don't match for line ending
Created by: telmich
have it uncommitted lying around - will push in the next hours
Created by: telmich
[15:39] artist:cdist% cat ~/test
abc
abc-def
[15:39] artist:cdist% awk '{ if(index($0, "abc")) print("ok") }' < ~/test
ok
ok
[15:39] artist:cdist% awk '{ if(match(
0, "^abc
")) print("ok") }' < ~/testok
Created by: telmich
maybe match() is a better choice:
Returns either the position in s where the regular expression r begins, or 0 if no occurrences are found. Sets the values of RSTART and RLENGTH.
Created by: telmich
Code:
awk -v prefix="$prefix" -v suffix="$suffix" '{
if (index($0,prefix)) {
triggered=1
}
if (triggered) {
if (index($0,suffix)) {
triggered=0
}
print
}