1
#!/bin/bash

awk 'NR!~/^(1|$q+2|$q+3)$/' deltay.txt > yota.txt

q is an integer obtain from a previous process in the script, and I need to erase lines one, the q+2 an q+3, but that command just erases lines 1... How to do it?
PS: I've tried with sed -e, but seems I don't own that command

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Diego
  • 309

1 Answers1

1
awk -vq="$q" 'NR>1&&NR!=q+2&&NR!=q+3' deltay.txt > yota.txt
Kamaraj
  • 4,365