Sed substitution possible with arithmetic involved?

前端 未结 4 1670
眼角桃花
眼角桃花 2020-12-16 21:18

File I need to modify contains the following:

block: 16, size: 16, start: 8, length: 4

I\'d like the file so that values for block<

4条回答
  •  遥遥无期
    2020-12-16 22:03

    Don't think it's possible. See e.g. http://www.delorie.com/gnu/docs/sed/sed_15.html.

    However if you only have a small set of possible values for block, size, start, and length, it might be quickest to hard-code the needed substitutions. The next-easiest option is probably to use awk, but that can't modify files in-place.

提交回复
热议问题