Last active
March 1, 2018 00:08
-
-
Save ahonor/d5aeb8aa20767e0fcf9fd1595e0f26e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"Tue Feb 27 02:39:35", | |
"Sun Feb 25 04:06:58", | |
"Mon Feb 26 01:03:08" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- description: '' | |
executionEnabled: true | |
id: 544bfdc9-da30-4822-a01e-2ca6f4285472 | |
loglevel: INFO | |
name: multi-options with spaces | |
nodeFilterEditable: false | |
options: | |
- delimiter: ',' | |
multivalued: true | |
name: dates | |
required: true | |
valuesUrl: file:/tmp/dates.json | |
scheduleEnabled: true | |
sequence: | |
commands: | |
- args: ${option.dates.delimiter} ${option.dates} | |
script: |- | |
#!/bin/bash | |
#1st arg is the delimiter string | |
declare -r delimiter=$1 | |
#everything else is a space containing date string. | |
declare -ra datepatterns=( ${@:2} ) | |
declare -i count=0 | |
IFS=$delimiter read -ra dates <<< "${datepatterns[@]}" | |
for d in "${dates[@]}" | |
do | |
printf "date %d: %s\n" "$count" "$d" | |
((count++)) | |
done | |
keepgoing: false | |
strategy: node-first | |
uuid: 544bfdc9-da30-4822-a01e-2ca6f4285472 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- description: '' | |
executionEnabled: true | |
id: 544bfdc9-da30-4822-a01e-2ca6f4285472 | |
loglevel: INFO | |
name: multi-options with spaces | |
nodeFilterEditable: false | |
options: | |
- delimiter: ',' | |
multivalued: true | |
name: dates | |
required: true | |
valuesUrl: file:/tmp/dates.json | |
scheduleEnabled: true | |
sequence: | |
commands: | |
- script: |- | |
echo "DEBUG: dates: @option.dates@" | |
IFS=, read -ra dates <<< "@option.dates@" | |
for d in "${dates[@]}" | |
do | |
printf "date: %s\n" "$d" | |
done | |
keepgoing: false | |
strategy: node-first | |
uuid: 544bfdc9-da30-4822-a01e-2ca6f4285472 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment