args2env - Turns command arguments into environment variables and executes command with the remained arguments



NAME

args2env - Turns command arguments into environment variables and executes command with the remained arguments


SYNOPSIS

args2env [OPTIONS] COMMAND ARG_1 ARG_2 ... ARG_R2 ARG_R1


DESCRIPTION


OPTIONS

-a, --arg NUM

Move the NUMth argument to the environment by the name ARG_NUM > (may be overridden by --template option). Counting starts from 1. The 0th argument would be the COMMAND itself. NUM may be negative number, in which case it's counted from the end backwards.

-r, --right-arg NUM

Same as --arg -NUM >.

-A, --all

Move all arguments to environment.

-k, --keep NUM

Keep the first NUM arguments as arguments, and move the rest of them to environment. Don't use it with -A, -a, or -r.

-t, --template TEMPLATE

How to name environment variables? Must contain a %d macro. Default is ARG_%d. So the value of argument given by --arg 1 goes to ARG_1 variable.

-nt, --negative-template TEMPLATE

How to name environment variables for arguments specified by negative number? Must contain a %d macro. Default is ARG_R%d, R is for "right", because this arg is counted from the right. So the value of argument given by --arg -1 goes to ARG_R1 variable.

-s, --set NAME=NUM

Set NAME variable to the NUMth argument (negative numbers also may be given) and remove the argument from the argument list (keeping the numbering of remaining arguments unchanged). Number-based variables (ARG_n > and ARG_Rn >) are still available.


SEE ALSO

args2stdin(1)