# phpman > man > envdir(8)

[envdir(8)](https://www.chedong.com/phpMan.php/man/envdir/8/markdown)                              System Manager's Manual                             [envdir(8)](https://www.chedong.com/phpMan.php/man/envdir/8/markdown)



## NAME
       envdir - runs another program with environment modified according to files in a specified di‐
       rectory.

## SYNOPSIS
       **envdir** _d_ _child_

## DESCRIPTION
       _d_ is a single argument.  _child_ consists of one or more arguments.

       **envdir** sets various environment variables as specified by files in the directory named _d_.  It
       then runs _child_.

       If  _d_  contains  a file named _s_ whose first line is _t_, **envdir** removes an environment variable
       named _s_ if one exists, and then adds an environment variable named _s_ with value _t_.  The  name
       _s_  must not contain =. Spaces and tabs at the end of _t_ are removed. Nulls in _t_ are changed to
       newlines in the environment variable.

       If the file _s_ is completely empty (0 bytes long),  **envdir**  removes  an  environment  variable
       named _s_ if one exists, without adding a new variable.

## EXIT CODES
       **envdir**  exits 111 if it has trouble reading _d_, if it runs out of memory for environment vari‐
       ables, or if it cannot run _child_.  Otherwise its exit code is the same as that of _child_.

## SEE ALSO
       [supervise(8)](https://www.chedong.com/phpMan.php/man/supervise/8/markdown),  [svc(8)](https://www.chedong.com/phpMan.php/man/svc/8/markdown),  [svok(8)](https://www.chedong.com/phpMan.php/man/svok/8/markdown),  [svstat(8)](https://www.chedong.com/phpMan.php/man/svstat/8/markdown),  [svscanboot(8)](https://www.chedong.com/phpMan.php/man/svscanboot/8/markdown),   [svscan(8)](https://www.chedong.com/phpMan.php/man/svscan/8/markdown),   [readproctitle(8)](https://www.chedong.com/phpMan.php/man/readproctitle/8/markdown),
       [fghack(8)](https://www.chedong.com/phpMan.php/man/fghack/8/markdown),  [pgrphack(8)](https://www.chedong.com/phpMan.php/man/pgrphack/8/markdown),  [multilog(8)](https://www.chedong.com/phpMan.php/man/multilog/8/markdown), [tai64n(8)](https://www.chedong.com/phpMan.php/man/tai64n/8/markdown), [tai64nlocal(8)](https://www.chedong.com/phpMan.php/man/tai64nlocal/8/markdown), [setuidgid(8)](https://www.chedong.com/phpMan.php/man/setuidgid/8/markdown), [envuidgid(8)](https://www.chedong.com/phpMan.php/man/envuidgid/8/markdown),
       [softlimit(8)](https://www.chedong.com/phpMan.php/man/softlimit/8/markdown), [setlock(8)](https://www.chedong.com/phpMan.php/man/setlock/8/markdown)

       <http://cr.yp.to/daemontools.html>



                                                                                           [envdir(8)](https://www.chedong.com/phpMan.php/man/envdir/8/markdown)
