WITHSTDINAS(1)

NAME
withstdinas - read the entirety of standard input in an environment variable, and run another program with that additional environment variable

SYNOPSIS
In an execlineb(1) script:

withstdinas [-i | -I | -D default] [-N | -n] [-E | -e] variable prog...

DESCRIPTION
withstdinas reads its stdin until EOF.

It then exec(3) s into prog..., with variable added to the environment; the value of variable is what was read on stdin.

You can start prog... with ‘importas -u variable variable’ to perform variable substitution.

OPTIONS

-N  Do not chomp an ending newline off stdin.

-n  Chomp an ending newline off stdin. This is the default.

-e  No autoimport. This is the default.

-E  Autoimport. Instead of exec(3) ing into prog..., exec(3) into ‘importas -ui variable variable prog...’. This substitutes variable into the command line instead of putting it into the environment.

The other options tell withstdinas what to do if its input is not suitable as the contents of an environment variable, i.e. it contains a null character:

-i  withstdinas exits 1.

-I  variable is removed from the environment, and execution proceeds.

-D default
    The value of variable is set to default, and execution proceeds.

When neither of those options is given, the value of variable is set to whatever the start of the input is, up to the first null character; and execution proceeds.

SEE ALSO
emptyenv(1), envfile(1), exec(1), execline-cd(1), execline-umask(1), execlineb(1), exit(1), export(1), fdblock(1), fdclose(1), fdmove(1), fdreserve(1), fdswap(1), getcwd(1), getpid(1), heredoc(1), piperw(1), posix-cd(1), posix-umask(1), redirfd(1), trap(1), tryexec(1), unexport(1), wait(1), exec(3)

This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/withstdinas.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)