More portable awk script
gensub() is specific to gawk, this uses gsub() instead in order to build on platforms that don't have gawk such as macOS.
This commit is contained in:
parent
9e3515f078
commit
3d05509b7c
18
lig.awk
18
lig.awk
|
@ -24,14 +24,20 @@ c=b
|
|||
c!=b { print c }
|
||||
|
||||
/f[1-9]?$/ {
|
||||
print gensub("f[1-9]?$", "ff", "g", b);
|
||||
if (c!=b) print gensub("f[1-9]?$", "ff", "g", c);
|
||||
out=b; gsub("f[1-9]?$", "ff", out); print out
|
||||
if (c!=b) {
|
||||
out=c; gsub("f[1-9]?$", "ff", out); print out
|
||||
}
|
||||
|
||||
print gensub("f[1-9]?$", "fi", "g", b);
|
||||
if (c!=b) print gensub("f[1-9]?$", "fi", "g", c);
|
||||
out=b; gsub("f[1-9]?$", "fi", out); print out
|
||||
if (c!=b) {
|
||||
out=c; gsub("f[1-9]?$", "fi", out); print out
|
||||
}
|
||||
|
||||
print gensub("f[1-9]?$", "fl", "g", b);
|
||||
if (c!=b) print gensub("f[1-9]?$", "fl", "g", c);
|
||||
out=b; gsub("f[1-9]?$", "fl", out); print out
|
||||
if (c!=b) {
|
||||
out=c; gsub("f[1-9]?$", "fl", out); print out
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue