adhoc - create jobs from adhoc bash code

moa.plugin.system.adhoc.createAdhoc(job)

Creates an adhoc job.

moa.plugin.system.adhoc.createMap(job, args)

create an adhoc moa ‘map’ job

Moa will query the user for process, input & output files. An example session

moa.plugin.system.adhoc.createReduce(job)

Create a ‘reduce’ adhoc job.

There are a number of ways this command can be used:

$ moa reduce -t 'a title' -- echo 'define a command'

Anything after will be the executable command. If omitted, Moa will query the user for a command.

Moa will also query the user for input & output files. An example session:

$ moa map -t 'something intelligent'
process:
> echo 'processing {{ input }} {{ output }}'
input:
> ../10.input/*.txt
output:
> ./*.out

Assuming you have a number of text files in the ../10/input/ directory, you will see, upon running:

processing ../10.input/test.01.txt ./test.01.out
processing ../10.input/test.02.txt ./test.02.out
processing ../10.input/test.03.txt ./test.03.out
...
moa.plugin.system.adhoc.exclamate(job, args)

Create a ‘simple’ job from the last command issued.

Set the process parameter to the last issued command. If a moa job exists in the current directory, then the process parameter is set without questions. (even if the Moa job in question does not use the process parameter). If no moa job exists, a simple job is created first.

Note: This works only when using bash and if moainit is sourced properly. moainit defines a bash function _moa_prompt that is called every time a command is issued (using $PROMPT_COMMAND). The _moa_prompt function takes the last command from the bash history and stores it in ~/.config/moa/last.command. Additionally, the _moa_prompt function stores all commands issued in a Moa directory in .moa/local_bash_history.

moa.plugin.system.adhoc.exclamateInJob(job, args, command)

Reuse the last issued command: set it as the ‘process’ parameters in the current job

moa.plugin.system.adhoc.exclamateNoJob(job, args, command)

Create a “simple” job & set the last command to the ‘process’ parameter

moa.plugin.system.adhoc.simple(job, args)

Create a ‘simple’ adhoc job.

Simple meaning that no in or output files are tracked. Moa will query you for a command to execute (the process parameter).

Previous topic

metavar - Create a number of meta variables

Next topic

configure - Configure jobs