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

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -