# compile and redirect errors



## nedry (May 22, 2017)

Hi, I install my ports via the ports tree, using `make install clean`. How do I redirect errors in to a text file to read if the compile fails?
Thanks


----------



## SirDice (May 22, 2017)

The easiest is to use script(1). This will capture pretty much everything. Redirection is a bit troublesome due to various other redirections that may happen during the build stages. 

Use it like this:

```
script /some/where/buildlog.txt
cd /usr/ports/some/port
make install
exit
```
Now the /some/where/buildlog.txt file will contain everything (including everything you typed).


----------

