What can I do to remove the repeated code that happens during the second printf
?
Surely there must be a more efficient way to add >> records.txt
to the end of a printf
without typing it again
if(($qs<=99999))
then
printf "${sp[x]} bonus is = £0 for ${qs[i]} QuarterlySales\n"
if [ $save == "y" ]
then
printf "${sp[x]} bonus is = £0 for ${qs[i]} QuarterlySales\n" >> records.txt
fi