Login  Register

Re: reset number after each month

Posted by Roshan on May 17, 2017; 11:37am
URL: http://erman-arslan-s-oracle-forum.124.s1.nabble.com/reset-number-after-each-month-tp2706p2708.html

everytime I run the script(.sh file)

#formatting output.unl
d=$(date "+%d.%m.%Y")
n=$(printf "%02d" "$((${n:-0} + 1))")
f="outputSMS_${d}_${n}.unl"

only outputSMS_17.05.2017_01.unl is produced
Every time I run this script, it should create a new file with n parameter incremented

for example:
first time
outputSMS_17.05.2017_01.unl

second time
outputSMS_17.05.2017_02.unl

etc..