linux - resetting value of a local variable -
i using local variable record in loop like
record=$(awk 'nf!=4 {print $0}' n20${i}) but everytime instead of taking new value appends last value new value. how can solve problem? in advance.
record=$(awk 'nf!=4 {print $0}' n20$((i++))) that increment value of i each time line executed.
or if want i+1 without changing value of i:
record=$(awk 'nf!=4 {print $0}' n20$((i+1)))
Comments
Post a Comment