Type in a command, or "ls dictionary" to search all commands for "dictionary", etc.

foreach

(This command has been awarded a Yubnub Golden Egg)

http://jonathanaquino.com/singpolymaplay/yubnub-foreach.php?xn_auth=no&data=%s&cmd=${cmd=echo}&as=${as}&type=${type}&callback=${callback}
NAME
     foreach - Loop through an 'array' and runs a YubNub command

EXAMPLES
     foreach {explode 1,2,3,4}
        echos each array item 1, 2, 3, and 4 (as produced by explode)
     
     foreach {explode 1,2,3,4} -cmd sum 1
        echos each array item increased by one
     
     foreach {explode 1,2,3,4} -cmd var tmp -set [|sum 1 %s|]
        sets var tmp to one greater than each array item, in order
     
     foreach {explode 1,2,3,4} -as array
        gives back an XML-type 'array' with the elements 1, 2, 3, and 4
     
     foreach {explode 1,2,3,4} -as array -type xoxo
        gives back an XOXO-type 'array' with the elements 1, 2, 3, and 4
     
     foreach {explode 1,2,3,4} -as array -type json
        gives back an JSON-type 'array' with the elements 1, 2, 3, and 4
     
     foreach {explode 1,2,3,4} -as array -type json -callback x
        gives back an JSON-type 'array' with the elements 1, 2, 3, and 4 and callback x

DESCRIPTION
     Loops through and 'array' in XML, XOXO, or JSON form (data wrapped in a
     JSONP callback will not work) and runs a YubNub command on it.

NOTES
     If the YubNub command has a '%s' specified in it then the array items are
     substituted in there, otherwise they are simply passed at the end of the command.
     
     If you want to use pipes in what you pass the -cmd parameter you must use the
     syntax [|cmd|] instead of {cmd} because otherwise YubNub would evaluate the
     piping before foreach was run.

AUTHOR
     Stephen Paul Weber
     http://singpolyma-tech.blogspot.com/
    
207531 uses - Created 2006-04-25 12:13:22 - Last used 2021-04-02 06:30:56
Is this command broken? Tell Jon if you know how to fix it.