m: don't increment variables inside subshell

This commit is contained in:
Lucas 2020-04-26 17:47:18 +00:00
parent 54f5477b0f
commit aa86bb5c6e
1 changed files with 8 additions and 8 deletions

View File

@ -38,14 +38,14 @@ _mlist_i_rec()
tmc=0 tmc=0
entries=0 entries=0
while IFS= read -r dir; do while IFS= read -r dir; do
mdirs "$dir" | mlist -i | tail -n 1 | { IFS=" " read -r uc ut fc ft mc mt dummy <<EOF
IFS=" " read -r uc ut fc ft mc mt dummy $(mdirs "$dir" | mlist -i | tail -n 1)
_mlist_i_rec_ln "$uc" "$fc" "$mc" "$dir" EOF
tuc=$((tuc + uc)) _mlist_i_rec_ln "$uc" "$fc" "$mc" "$dir"
tfc=$((tfc + fc)) tuc=$((tuc + uc))
tmc=$((tmc + mc)) tfc=$((tfc + fc))
entries=$((entries + 1)) tmc=$((tmc + mc))
} entries=$((entries + 1))
done done
if [ $entries -gt 1 ]; then if [ $entries -gt 1 ]; then
_mlist_i_rec_ln "$tuc" "$tfc" "$tmc" _mlist_i_rec_ln "$tuc" "$tfc" "$tmc"