File tree Expand file tree Collapse file tree 1 file changed +29
-34
lines changed Expand file tree Collapse file tree 1 file changed +29
-34
lines changed Original file line number Diff line number Diff line change @@ -1159,57 +1159,52 @@ p_PID+=(\${p{<#>}_PID})""" )"
1159
1159
# initialize real-time printing of ordered output as forkrun runs
1160
1160
outCur=10
1161
1161
continueFlag=true
1162
+ outPrint=()
1162
1163
1163
1164
while ${continueFlag} ; do
1164
1165
1165
1166
# read order indices that are done running.
1166
- while true ; do
1167
- read -r -u ${fd_nOrder0}
1168
- case " ${REPLY} " in
1169
- + ([0-9]))
1170
- # index has an output file
1171
- outHave[${REPLY} ]=1
1172
- ;;
1173
- x+ ([0-9]))
1174
- # index was empty
1175
- outHave[${REPLY# x} ]=0
1176
- ;;
1177
- ' ' )
1178
- # end condition was met
1179
- continueFlag=false
1180
- break
1181
- ;;
1182
- esac
1183
- [[ ${outHave[${outCur}]} ]] && break
1184
- done
1167
+ read -r -u ${fd_nOrder0}
1168
+ case " ${REPLY} " in
1169
+ + ([0-9]))
1170
+ # index has an output file
1171
+ outHave[${REPLY} ]=1
1172
+ ;;
1173
+ x+ ([0-9]))
1174
+ # index was empty
1175
+ outHave[${REPLY# x} ]=0
1176
+ ;;
1177
+ ' ' )
1178
+ # end condition was met
1179
+ continueFlag=false
1180
+ break
1181
+ ;;
1182
+ esac
1185
1183
1186
1184
# starting at $outCur, print all indices in sequential order that have been recorded as being run and then remove the tmp output file[s]
1187
1185
1188
- outPrint=()
1189
-
1190
- while (( ${# outPrint[@]} < 128 )) ; do
1191
- case " ${outHave[${outCur}]} " in
1192
- 1)
1193
- outPrint+=(" ${tmpDir} /.out/x${outCur} " )
1194
- ;;
1195
- 0)
1196
-
1197
- ;;
1198
- * )
1199
- break
1200
- ;;
1201
- esac
1186
+ while [[ " ${outHave[${outCur}]} " ]]; do
1187
+
1188
+ [[ " ${outHave[${outCur}]} " == 1 ]] && outPrint+=(" ${tmpDir} /.out/x${outCur} " )
1202
1189
1203
1190
unset " outHave[${outCur} ]"
1204
1191
1205
1192
# advance outCur by 1
1206
1193
(( outCur++ ))
1207
1194
[[ " ${outCur} " == + (9)+ (0) ]] && outCur=" ${outCur} 00"
1195
+
1196
+ [[ ${# outPrint[@]} == 128 ]] && {
1197
+ cat " ${outPrint[@]} "
1198
+ \r m -f " ${outPrint[@]} "
1199
+ outPrint=()
1200
+ }
1201
+
1208
1202
done
1209
-
1203
+
1210
1204
[[ ${# outPrint[@]} == 0 ]] || {
1211
1205
cat " ${outPrint[@]} "
1212
1206
\r m -f " ${outPrint[@]} "
1207
+ outPrint=()
1213
1208
}
1214
1209
1215
1210
# check for end condition
You can’t perform that action at this time.
0 commit comments