Skip to main content
deleted 2 characters in body
Source Link
oguz ismail
  • 51.8k
  • 16
  • 64
  • 83

Something like this should do that:

awk '{ for (i = 1; sub(/foo/, "bar" i); i++) { }; } 1' file

Note that foo is interpreted as a regular expression.

Something like this should do that:

awk '{ for (i = 1; sub(/foo/, "bar" i); i++) { } } 1' file

Note that foo is interpreted as a regular expression.

Something like this should do that:

awk '{ for (i = 1; sub(/foo/, "bar" i); i++) ; } 1' file

Note that foo is interpreted as a regular expression.

Source Link
oguz ismail
  • 51.8k
  • 16
  • 64
  • 83

Something like this should do that:

awk '{ for (i = 1; sub(/foo/, "bar" i); i++) { } } 1' file

Note that foo is interpreted as a regular expression.