Whats wrong with this synta, it always gives error at line 1
awk -v fn=web.xml.sv BEGIN'{
while ((getline arr[a++] < fn) > 0) {
m++
}
print m, "records read from", fn
for (x in arr) {
if (arr[x] !~ /!!.*!!/) {
delete arr[x]
}
}
}
{
for (all in arr) {
gsub(/!!/,"",arr[all])
if ($0 == arr[all]) {
$0 = "!!" $0 "!!"
}
}
print $0 > tempfile
}'web.xml
awk -v fn=web.xml.sv BEGIN'{
while ((getline arr[a++] < fn) > 0) {
m++
}
print m, "records read from", fn
for (x in arr) {
if (arr[x] !~ /!!.*!!/) {
delete arr[x]
}
}
}
{
for (all in arr) {
gsub(/!!/,"",arr[all])
if ($0 == arr[all]) {
$0 = "!!" $0 "!!"
}
}
print $0 > tempfile
}'web.xml