We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23e970a commit dac584bCopy full SHA for dac584b
1 file changed
wdl/tasks/Utility/GeneralUtils.wdl
@@ -245,6 +245,32 @@ task ConcatenateFiles {
245
}
246
247
248
+task AddIntegers {
249
+ meta {
250
+ description:
251
+ "Add an array of integers."
252
+ warn:
253
+ "Be cautious with large arrays and/or arrays with very large values due to potential integer overflow."
254
+ }
255
+ input {
256
+ Array[Int] integers
257
258
+ output {
259
+ Int sum = read_int("result.txt")
260
261
+ command <<<
262
+ set -euxo pipefail
263
+
264
+ echo ~{sep=' ' integers} \
265
+ | awk '{s=0; for(i=1;i<=NF;i++)s+=$i; print s}' \
266
+ > result.txt
267
+ >>>
268
+ runtime {
269
+ disks: "local-disk 10 HDD"
270
+ docker: "marketplace.gcr.io/google/ubuntu2404:latest"
271
272
+}
273
274
struct HelperStructForUnzip {
275
Array[Pair[String, String]] contents
276
0 commit comments