-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTermux_RUN_COMMAND_Intent_Tudo_Templates.tsk.xml
executable file
·950 lines (887 loc) · 42.3 KB
/
Termux_RUN_COMMAND_Intent_Tudo_Templates.tsk.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
<TaskerData sr="" dvi="1" tv="5.11.7.beta">
<Task sr="task1000">
<cdate>1604448827988</cdate>
<edate>1607961099674</edate>
<id>1000</id>
<nme>Termux RUN_COMMAND Intent Tudo Templates</nme>
<pri>100</pri>
<Share sr="Share">
<d>A task that provides templates for running `tudo` script commands with the `RUN_COMMAND` intent in `termux` user context in termux. The commands are run using the Tasker `TermuxCommand()` function of the `Tasker Function` action and with the `am` command with the `Run Shell` action and are referred as intent actions in this task. This task requires Termux:Tasker version `>= 0.5`. Tasker must be granted `com.termux.permission.RUN_COMMAND` permission. The `tudo` script must be installed at `$PREFIX/bin/tudo`. The `allow-external-apps` property must also be set to `true` in `~/.termux/termux.properties` file, otherwise any commands received via the `RUN_COMMAND` intent will not be executed by Termux. For android `>= 10`, Termux must also be granted `Draw Over Apps` permissions so that foreground commands automatically start executing without the user having to manually click the `Termux` notification in the status bar dropdown notifications list for the commands to start.
Check [Termux:Tasker Github](/~https://github.com/termux/termux-tasker) and [RunCommand Intent](/~https://github.com/termux/termux-app/blob/master/app/src/main/java/com/termux/app/RunCommandService.java) for more details on `RUN_COMMAND` intent configuration.
Check [tudo](/~https://github.com/agnostic-apollo/tudo) for more details for the `tudo` script.
The result of commands is not received back when commands are run with the `RUN_COMMAND` intent, hence all templates run their commands in the foreground terminal session so that the results can be viewed. The `--sleep=3` command option is also passed to `tudo` so that it sleeps for `3` seconds before exiting. If this is not passed, the terminal would immediately close after `tudo` executes its commands without giving the user a chance to view the results in the terminal session. Moreover, a `Wait` action of `2` seconds is also added to the task after each template so that the templates execute in order and don't start until the previous one has at least ideally started executing.
The default value of the `%comma_alternative` variable in this task is set to `‚` (`#U+201A`, `&sbquo;`, `&#8218;`, `single low-9 quotation mark`). This is the same character that is replaced with the simple comma `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) by the `tudo` script by default when the `-r` option is passed. You can use a different character that should be replaced using the `--comma-alternative` option.
Template 1 runs the `$PREFIX/bin/tudo --sleep=3 getprop "ro.build.version.sdk"` command in the foreground using `TermuxCommand()` function as a template for the `path` `command_type` to get the android sdk version of the device. The arguments do not contain any simple comma characters and hence can be passed directly without having to replace them with `%comma_alternative` characters.
Template 2 runs the `$PREFIX/bin/tudo -sr --sleep=3 '%core_script' '%argument_1' '%argument_2'` command in the foreground using `TermuxCommand()` function as a template for the `script` `command_type` with `bash` as the `tudo shell`, which would be chosen automatically by default without having to pass the `--shell` option. The `termux_tasker_basic_bash_test` `bash` script text is passed as the `core_script` argument with 2 complex dynamic args that may contain simple comma characters. The `-s` command option is passed to set `command_type` to `script`. The `-r` command option is passed so that `tudo` parses the arguments as per `RUN_COMMAND` intent rules. The `tudo` executable is passed to the intent using the `%executable` variable. The `%core_script`, `%argument_1` and `%argument_2` variables are used to store the dynamic values to be sent as `$1`, `$2` and `$3` respectively to `tudo`. They are first all set in the `%arguments` variable separated by simple comma characters, which is passed to the intent. The `%core_script`, `%argument_1` and `%argument_2` variables may contain any type of characters, even a simple comma, but simple commas must be replaced with the `%comma_alternative` characters before the intent action is run so that their values are not split into multiple arguments by the intent. To replace the simple commas, `Variable Search Replace` action is run to replace all simple commas `,` with the `%comma_alternative` variable value. The `Variable Search Replace` action must be used separately for each argument variable before adding it to the `%arguments` variable. Do not set multiple arguments in the same variable and use `Variable Search Replace` action on it since that will result in incorrect argument splitting. This template shows how you can dynamically create intent commands at runtime using variables and send them via the `RUN_COMMAND` intent to Termux for execution, including passing the script text itself without having to create a physical file in `~/.termux/tasker/` directory.
Template 3 is almost the same as Template 2, but it runs the `$PREFIX/bin/tudo -sr --shell=python --sleep=3 '%core_script' '%argument_1' '%argument_2'` command in the foreground using `am` command as a template for the `script` `command_type` with `python` as the `tudo shell`. The `termux_tasker_basic_python_test` `python` script text is passed as the `core_script` argument with 2 complex dynamic args that may contain simple comma characters. However, as already mentioned that this template uses the `am` command, the `%arguments` variable is passed to the `com.termux.RUN_COMMAND_ARGUMENTS` string array extra surrounded with single quotes inside a shell and hence any single quotes inside the `%arguments` variable also need to be escaped before running the intent command to prevent incorrect quoting. To escape the single quotes, `Variable Search Replace` action is run to replace all single quotes `'` with one single quote, followed by one backslash, followed by two single quotes `'\''`. So `%arguments` surrounded with single quotes that would have been passed like `'some arg with single quote ' in it'` will be passed as `'some arg with single quote '\'' in it'`. This is basically 3 parts `'some arg with single quote '`, `\'` and `' in it'` but when processed, it will be considered as one single argument with the value `some arg with single quote ' in it` that is passed as the `com.termux.RUN_COMMAND_ARGUMENTS` string array extra value. The `Variable Search Replace` action does not need to be used separately for each argument variable before adding it to the `%arguments` variable, running it on only the final `%arguments` variable would be fine, unlike how its done on individual argument variables like `%argument_1`, etc for usage with `Termux:Tasker` plugin.
Template 4 runs `$PREFIX/bin/tudo --shell-pre-commands="echo 'starting tudo shell';" --title='tudo' su` in the foreground using `TermuxCommand()` function as a template for the `su` `command_type` to start an interactive `bash` shell with priority to termux binaries and libraries. The `--shell-pre-commands` option is passed to run some commands before starting the interactive `bash` shell and its argument is **not** passed surrounded with single or double quotes to prevent whitespace splitting in the intent action, like done for usage with `Termux:Tasker` plugin since splitting will occur on simple comma characters instead. If there are going to be simple comma characters in arguments to the command options or in the main arguments to `tudo`, you must replace them with `%comma_alternative` variable value and pass the `-r` option. The `--title` option is passed to set the title of the terminal.
The `$PREFIX/` is a shortcut for the termux prefix directory `/data/data/com.termux/files/usr/`. The `~/` is a shortcut for the termux home directory `/data/data/com.termux/files/home/`. These shortcuts can be used in any path arguments to the `tudo` command.
The `%command_failed` variable will be set if the intent action failed, this is detected by whether `%err` or `%errmsg` is set by the intent action. If you run multiple intent actions in the same task or are using `Local Variable Passthrough`, then you must clear the `%command_failed` variable and optionally the `%errmsg` variable with the `Variable Clear` action before running each intent action, in case they were already set, like by a previously failed intent action after which the task was not stopped.
##
**Parameters:** `-`
**Returns:** `-`
**Control:**
```
version_name: 0.1.0
```</d>
<p>false</p>
<t></t>
</Share>
<Action sr="act0" ve="7">
<code>300</code>
<label>A task that provides templates for running `tudo` script commands with the `RUN_COMMAND` intent in `termux` user context in termux. The commands are run using the Tasker `TermuxCommand()` function of the `Tasker Function` action and with the `am` command with the `Run Shell` action and are referred as intent actions in this task. This task requires Termux:Tasker version `>= 0.5`. Tasker must be granted `com.termux.permission.RUN_COMMAND` permission. The `tudo` script must be installed at `$PREFIX/bin/tudo`. The `allow-external-apps` property must also be set to `true` in `~/.termux/termux.properties` file, otherwise any commands received via the `RUN_COMMAND` intent will not be executed by Termux. For android `>= 10`, Termux must also be granted `Draw Over Apps` permissions so that foreground commands automatically start executing without the user having to manually click the `Termux` notification in the status bar dropdown notifications list for the commands to start.
Check [Termux:Tasker Github](/~https://github.com/termux/termux-tasker) and [RunCommand Intent](/~https://github.com/termux/termux-app/blob/master/app/src/main/java/com/termux/app/RunCommandService.java) for more details on `RUN_COMMAND` intent configuration.
Check [tudo](/~https://github.com/agnostic-apollo/tudo) for more details for the `tudo` script.
The result of commands is not received back when commands are run with the `RUN_COMMAND` intent, hence all templates run their commands in the foreground terminal session so that the results can be viewed. The `--sleep=3` command option is also passed to `tudo` so that it sleeps for `3` seconds before exiting. If this is not passed, the terminal would immediately close after `tudo` executes its commands without giving the user a chance to view the results in the terminal session. Moreover, a `Wait` action of `2` seconds is also added to the task after each template so that the templates execute in order and don't start until the previous one has at least ideally started executing.
The default value of the `%comma_alternative` variable in this task is set to `‚` (`#U+201A`, `&sbquo;`, `&#8218;`, `single low-9 quotation mark`). This is the same character that is replaced with the simple comma `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) by the `tudo` script by default when the `-r` option is passed. You can use a different character that should be replaced using the `--comma-alternative` option.
Template 1 runs the `$PREFIX/bin/tudo --sleep=3 getprop "ro.build.version.sdk"` command in the foreground using `TermuxCommand()` function as a template for the `path` `command_type` to get the android sdk version of the device. The arguments do not contain any simple comma characters and hence can be passed directly without having to replace them with `%comma_alternative` characters.
Template 2 runs the `$PREFIX/bin/tudo -sr --sleep=3 '%core_script' '%argument_1' '%argument_2'` command in the foreground using `TermuxCommand()` function as a template for the `script` `command_type` with `bash` as the `tudo shell`, which would be chosen automatically by default without having to pass the `--shell` option. The `termux_tasker_basic_bash_test` `bash` script text is passed as the `core_script` argument with 2 complex dynamic args that may contain simple comma characters. The `-s` command option is passed to set `command_type` to `script`. The `-r` command option is passed so that `tudo` parses the arguments as per `RUN_COMMAND` intent rules. The `tudo` executable is passed to the intent using the `%executable` variable. The `%core_script`, `%argument_1` and `%argument_2` variables are used to store the dynamic values to be sent as `$1`, `$2` and `$3` respectively to `tudo`. They are first all set in the `%arguments` variable separated by simple comma characters, which is passed to the intent. The `%core_script`, `%argument_1` and `%argument_2` variables may contain any type of characters, even a simple comma, but simple commas must be replaced with the `%comma_alternative` characters before the intent action is run so that their values are not split into multiple arguments by the intent. To replace the simple commas, `Variable Search Replace` action is run to replace all simple commas `,` with the `%comma_alternative` variable value. The `Variable Search Replace` action must be used separately for each argument variable before adding it to the `%arguments` variable. Do not set multiple arguments in the same variable and use `Variable Search Replace` action on it since that will result in incorrect argument splitting. This template shows how you can dynamically create intent commands at runtime using variables and send them via the `RUN_COMMAND` intent to Termux for execution, including passing the script text itself without having to create a physical file in `~/.termux/tasker/` directory.
Template 3 is almost the same as Template 2, but it runs the `$PREFIX/bin/tudo -sr --shell=python --sleep=3 '%core_script' '%argument_1' '%argument_2'` command in the foreground using `am` command as a template for the `script` `command_type` with `python` as the `tudo shell`. The `termux_tasker_basic_python_test` `python` script text is passed as the `core_script` argument with 2 complex dynamic args that may contain simple comma characters. However, as already mentioned that this template uses the `am` command, the `%arguments` variable is passed to the `com.termux.RUN_COMMAND_ARGUMENTS` string array extra surrounded with single quotes inside a shell and hence any single quotes inside the `%arguments` variable also need to be escaped before running the intent command to prevent incorrect quoting. To escape the single quotes, `Variable Search Replace` action is run to replace all single quotes `'` with one single quote, followed by one backslash, followed by two single quotes `'\''`. So `%arguments` surrounded with single quotes that would have been passed like `'some arg with single quote ' in it'` will be passed as `'some arg with single quote '\'' in it'`. This is basically 3 parts `'some arg with single quote '`, `\'` and `' in it'` but when processed, it will be considered as one single argument with the value `some arg with single quote ' in it` that is passed as the `com.termux.RUN_COMMAND_ARGUMENTS` string array extra value. The `Variable Search Replace` action does not need to be used separately for each argument variable before adding it to the `%arguments` variable, running it on only the final `%arguments` variable would be fine, unlike how its done on individual argument variables like `%argument_1`, etc for usage with `Termux:Tasker` plugin.
Template 4 runs `$PREFIX/bin/tudo --shell-pre-commands="echo 'starting tudo shell';" --title='tudo' su` in the foreground using `TermuxCommand()` function as a template for the `su` `command_type` to start an interactive `bash` shell with priority to termux binaries and libraries. The `--shell-pre-commands` option is passed to run some commands before starting the interactive `bash` shell and its argument is **not** passed surrounded with single or double quotes to prevent whitespace splitting in the intent action, like done for usage with `Termux:Tasker` plugin since splitting will occur on simple comma characters instead. If there are going to be simple comma characters in arguments to the command options or in the main arguments to `tudo`, you must replace them with `%comma_alternative` variable value and pass the `-r` option. The `--title` option is passed to set the title of the terminal.
The `$PREFIX/` is a shortcut for the termux prefix directory `/data/data/com.termux/files/usr/`. The `~/` is a shortcut for the termux home directory `/data/data/com.termux/files/home/`. These shortcuts can be used in any path arguments to the `tudo` command.
The `%command_failed` variable will be set if the intent action failed, this is detected by whether `%err` or `%errmsg` is set by the intent action. If you run multiple intent actions in the same task or are using `Local Variable Passthrough`, then you must clear the `%command_failed` variable and optionally the `%errmsg` variable with the `Variable Clear` action before running each intent action, in case they were already set, like by a previously failed intent action after which the task was not stopped.
##
**Parameters:** `-`
**Returns:** `-`
**Control:**
```
version_name: 0.1.0
```</label>
</Action>
<Action sr="act1" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%task_name</Str>
<Str sr="arg1" ve="3">Termux RUN_COMMAND Intent Tudo Templates</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act10" ve="7">
<code>377</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%td_button
Button
The label of the button that was clicked</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">Template 1 Command
Failed</Str>
<Str sr="arg2" ve="3">%command_failed</Str>
<Str sr="arg3" ve="3">OK</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="30"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act11" ve="7">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
</Action>
<Action sr="act12" ve="7">
<code>38</code>
</Action>
<Action sr="act13" ve="7">
<code>300</code>
<label>Template 1 End</label>
</Action>
<Action sr="act14" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act15" ve="7">
<code>300</code>
<label>Template 2 Start</label>
</Action>
<Action sr="act16" ve="7">
<code>135</code>
<label>Goto "Template 3 Start"
Enable this action to skip running this template</label>
<on>false</on>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">Template 3 Start</Str>
</Action>
<Action sr="act17" ve="7">
<code>300</code>
<label>Run `$PREFIX/bin/tudo -sr --sleep=3 '%core_script' '%argument_1' '%argument_2'` Command In Foreground</label>
</Action>
<Action sr="act18" ve="7">
<code>547</code>
<label>set `‚` (`#U+201A`, `&sbquo;`, `&#8218;`, `single low-9 quotation mark`) to %comma_alternative</label>
<Str sr="arg0" ve="3">%comma_alternative</Str>
<Str sr="arg1" ve="3">‚</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act19" ve="7">
<code>547</code>
<label>set `$PREFIX/bin/tudo` to %executable</label>
<Str sr="arg0" ve="3">%executable</Str>
<Str sr="arg1" ve="3">$PREFIX/bin/tudo</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act2" ve="7">
<code>300</code>
<label>Template 1 Start</label>
</Action>
<Action sr="act20" ve="7">
<code>547</code>
<label>set `termux_tasker_basic_bash_test` script text to %core_script</label>
<Str sr="arg0" ve="3">%core_script</Str>
<Str sr="arg1" ve="3">#if parameter count is not 2
if [ $# -ne 2 ]; then
echo "Invalid parameter count '$#' to 'termux_tasker_basic_bash_test'" 1>&2
echo "$*" 1>&2
exit 1
fi
echo "\$1=\`$1\`"
echo "\$2=\`$2\`"
exit 0</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act21" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%argument_1</Str>
<Str sr="arg1" ve="3">json</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act22" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%argument_2</Str>
<Str sr="arg1" ve="3">{
"name":"I'm Termux",
"license":"GPLv3",
"addons": {
"1":"Termux:API",
"2":"Termux:Boot",
"3":"Termux:Float",
"4":"Termux:Styling",
"5":"Termux:Tasker",
"6":"Termux:Widget"
}
}</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act23" ve="7">
<code>598</code>
<label>replace all simple commas `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) with %comma_alternative characters</label>
<Str sr="arg0" ve="3">%core_script</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">%comma_alternative</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%core_script</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act24" ve="7">
<code>598</code>
<label>replace all simple commas `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) with %comma_alternative characters</label>
<Str sr="arg0" ve="3">%argument_1</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">%comma_alternative</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%argument_1</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act25" ve="7">
<code>598</code>
<label>replace all simple commas `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) with %comma_alternative characters</label>
<Str sr="arg0" ve="3">%argument_2</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">%comma_alternative</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%argument_2</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act26" ve="7">
<code>547</code>
<label>set `-sr,--sleep=3,%core_script,%argument_1,%argument_2` to %arguments</label>
<Str sr="arg0" ve="3">%arguments</Str>
<Str sr="arg1" ve="3">-sr,--sleep=3,%core_script,%argument_1,%argument_2</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act27" ve="7">
<code>547</code>
<label>set `%executable,%arguments,/data/data/com.termux/files/home,false` to %termux_command</label>
<Str sr="arg0" ve="3">%termux_command</Str>
<Str sr="arg1" ve="3">%executable,%arguments,/data/data/com.termux/files/home,false</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act28" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%command_failed/%errmsg</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act29" ve="7">
<code>365</code>
<label>Run Termux RUN_COMMAND Intent Command with TermuxCommand() Function</label>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""/></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">TermuxCommand(%termux_command)</Str>
</Action>
<Action sr="act3" ve="7">
<code>135</code>
<label>Goto "Template 2 Start"
Enable this action to skip running this template</label>
<on>false</on>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">Template 2 Start</Str>
</Action>
<Action sr="act30" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%command_failed</Str>
<Str sr="arg1" ve="3">err = `%err`
errmsg =
```
%errmsg
```</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
<ConditionList sr="if">
<bool0>Or</bool0>
<Condition sr="c0" ve="3">
<lhs>%err</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%errmsg</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act31" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%command_failed</lhs>
<op>12</op>
<rhs>\%err
\%errmsg</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act32" ve="7">
<code>377</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%td_button
Button
The label of the button that was clicked</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">Template 2 Command
Failed</Str>
<Str sr="arg2" ve="3">%command_failed</Str>
<Str sr="arg3" ve="3">OK</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="30"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act33" ve="7">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
</Action>
<Action sr="act34" ve="7">
<code>38</code>
</Action>
<Action sr="act35" ve="7">
<code>300</code>
<label>Template 2 End</label>
</Action>
<Action sr="act36" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act37" ve="7">
<code>300</code>
<label>Template 3 Start</label>
</Action>
<Action sr="act38" ve="7">
<code>135</code>
<label>Goto "Template 4 Start"
Enable this action to skip running this template</label>
<on>false</on>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">Template 4 Start</Str>
</Action>
<Action sr="act39" ve="7">
<code>300</code>
<label>Run `$PREFIX/bin/tudo -sr --shell=python --sleep=3 '%core_script' '%argument_1' '%argument_2'` Command In Foreground</label>
</Action>
<Action sr="act4" ve="7">
<code>300</code>
<label>Run `$PREFIX/bin/tudo --sleep=3 getprop "ro.build.version.sdk"` Command In Foreground</label>
</Action>
<Action sr="act40" ve="7">
<code>547</code>
<label>set `‚` (`#U+201A`, `&sbquo;`, `&#8218;`, `single low-9 quotation mark`) to %comma_alternative</label>
<Str sr="arg0" ve="3">%comma_alternative</Str>
<Str sr="arg1" ve="3">‚</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act41" ve="7">
<code>547</code>
<label>set `$PREFIX/bin/tudo` to %executable</label>
<Str sr="arg0" ve="3">%executable</Str>
<Str sr="arg1" ve="3">$PREFIX/bin/tudo</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act42" ve="7">
<code>547</code>
<label>set `termux_tasker_basic_python_test` script text to %core_script</label>
<Str sr="arg0" ve="3">%core_script</Str>
<Str sr="arg1" ve="3">import sys
argv_size = len(sys.argv) - 1
# if parameter count is not 2
if argv_size != 2:
print("Invalid parameter count '%s' to 'termux_tasker_basic_python_test'" % argv_size, file=sys.stderr)
print("%s" % " ".join(sys.argv[1:]), file=sys.stderr)
sys.exit(1)
print("$1=`%s`" % sys.argv[1])
print("$2=`%s`" % sys.argv[2])
sys.exit(0)</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act43" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%argument_1</Str>
<Str sr="arg1" ve="3">json</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act44" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%argument_2</Str>
<Str sr="arg1" ve="3">{
"name":"I'm Termux",
"license":"GPLv3",
"addons": {
"1":"Termux:API",
"2":"Termux:Boot",
"3":"Termux:Float",
"4":"Termux:Styling",
"5":"Termux:Tasker",
"6":"Termux:Widget"
}
}</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act45" ve="7">
<code>598</code>
<label>replace all simple commas `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) with %comma_alternative characters</label>
<Str sr="arg0" ve="3">%core_script</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">%comma_alternative</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%core_script</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act46" ve="7">
<code>598</code>
<label>replace all simple commas `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) with %comma_alternative characters</label>
<Str sr="arg0" ve="3">%argument_1</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">%comma_alternative</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%argument_1</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act47" ve="7">
<code>598</code>
<label>replace all simple commas `,` (`U+002C`, `&comma;`, `&#44;`, `comma`) with %comma_alternative characters</label>
<Str sr="arg0" ve="3">%argument_2</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">%comma_alternative</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%argument_2</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act48" ve="7">
<code>547</code>
<label>set `-sr,--shell=python,--sleep=3,%core_script,%argument_1,%argument_2` to %arguments</label>
<Str sr="arg0" ve="3">%arguments</Str>
<Str sr="arg1" ve="3">-sr,--shell=python,--sleep=3,%core_script,%argument_1,%argument_2</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act49" ve="7">
<code>598</code>
<label>replace all single quotes (') with ('\'')</label>
<Str sr="arg0" ve="3">%arguments</Str>
<Str sr="arg1" ve="3">'</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="1"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">'\\''</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%arguments</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act5" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%command_failed/%errmsg</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act50" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%command_failed/%errmsg</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act51" ve="7">
<code>123</code>
<label>Run Termux RUN_COMMAND Intent Command with `am` Command</label>
<se>false</se>
<Str sr="arg0" ve="3">am startservice --user 0 -n com.termux/com.termux.app.RunCommandService -a com.termux.RUN_COMMAND --es com.termux.RUN_COMMAND_PATH '%executable' --esa com.termux.RUN_COMMAND_ARGUMENTS '%arguments' --es com.termux.RUN_COMMAND_WORKDIR '/data/data/com.termux/files/home' --ez com.termux.RUN_COMMAND_BACKGROUND 'false'</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3">%stdout</Str>
<Str sr="arg4" ve="3">%stderr</Str>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act52" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%command_failed</Str>
<Str sr="arg1" ve="3">err = `%err`
errmsg =
```
%errmsg
```
stdout =
```
%stdout
```
stderr =
```
%stderr
```</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
<ConditionList sr="if">
<bool0>Or</bool0>
<Condition sr="c0" ve="3">
<lhs>%err</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%errmsg</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act53" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%command_failed</lhs>
<op>12</op>
<rhs>\%err
\%errmsg</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act54" ve="7">
<code>598</code>
<label>remove %err and %errmsg if not set</label>
<se>false</se>
<Str sr="arg0" ve="3">%command_failed</Str>
<Str sr="arg1" ve="3">^err = `\%err`[\n]+errmsg =[\n]```[\n]\%errmsg[\n]```[\n]+</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%command_failed</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act55" ve="7">
<code>377</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%td_button
Button
The label of the button that was clicked</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">Template 3 Command
Failed</Str>
<Str sr="arg2" ve="3">%command_failed</Str>
<Str sr="arg3" ve="3">OK</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="30"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act56" ve="7">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
</Action>
<Action sr="act57" ve="7">
<code>43</code>
</Action>
<Action sr="act58" ve="7">
<code>377</code>
<on>false</on>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%td_button
Button
The label of the button that was clicked</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">Template 3 Command Result</Str>
<Str sr="arg2" ve="3">stdout =
```
%stdout
```
stderr =
```
%stderr
```</Str>
<Str sr="arg3" ve="3">OK</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="30"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act59" ve="7">
<code>38</code>
</Action>
<Action sr="act6" ve="7">
<code>365</code>
<label>Run Termux RUN_COMMAND Intent Command with TermuxCommand() Function</label>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""/></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">TermuxCommand($PREFIX/bin/tudo,--sleep=3,getprop,ro.build.version.sdk,/data/data/com.termux/files/home,false)</Str>
</Action>
<Action sr="act60" ve="7">
<code>300</code>
<label>Template 3 End</label>
</Action>
<Action sr="act61" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act62" ve="7">
<code>300</code>
<label>Template 4 Start</label>
</Action>
<Action sr="act63" ve="7">
<code>135</code>
<label>Goto "Return"
Enable this action to skip running this template</label>
<on>false</on>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">Return</Str>
</Action>
<Action sr="act64" ve="7">
<code>300</code>
<label>Run `$PREFIX/bin/tudo --shell-pre-commands="echo 'starting tudo shell';" --title='tudo' su` Command In Foreground</label>
</Action>
<Action sr="act65" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%command_failed/%errmsg</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act66" ve="7">
<code>365</code>
<label>Run Termux RUN_COMMAND Intent Command with TermuxCommand() Function</label>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""/></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">TermuxCommand($PREFIX/bin/tudo,--shell-pre-commands=echo 'starting tudo shell';,--title='tudo',su,/data/data/com.termux/files/home,false)</Str>
</Action>
<Action sr="act67" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%command_failed</Str>
<Str sr="arg1" ve="3">err = `%err`
errmsg =
```
%errmsg
```</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
<ConditionList sr="if">
<bool0>Or</bool0>
<Condition sr="c0" ve="3">
<lhs>%err</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%errmsg</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act68" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%command_failed</lhs>
<op>12</op>
<rhs>\%err
\%errmsg</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act69" ve="7">
<code>377</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%td_button
Button
The label of the button that was clicked</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">Template 4 Command
Failed</Str>
<Str sr="arg2" ve="3">%command_failed</Str>
<Str sr="arg3" ve="3">OK</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="30"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act7" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%command_failed</Str>
<Str sr="arg1" ve="3">err = `%err`
errmsg =
```
%errmsg
```
stdout =
```
%stdout
```
stderr =
```
%stderr
```</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
<ConditionList sr="if">
<bool0>Or</bool0>
<Condition sr="c0" ve="3">
<lhs>%err</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%errmsg</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act70" ve="7">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
</Action>
<Action sr="act71" ve="7">
<code>38</code>
</Action>
<Action sr="act72" ve="7">
<code>300</code>
<label>Template 4 End</label>
</Action>
<Action sr="act73" ve="7">
<code>300</code>
<label>Return</label>
</Action>
<Action sr="act8" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%command_failed</lhs>
<op>12</op>
<rhs>\%err
\%errmsg</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act9" ve="7">
<code>598</code>
<label>remove %err and %errmsg if not set</label>
<se>false</se>
<Str sr="arg0" ve="3">%command_failed</Str>
<Str sr="arg1" ve="3">^err = `\%err`[\n]+errmsg =[\n]```[\n]\%errmsg[\n]```[\n]+</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%command_failed</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
</Task>
</TaskerData>