# error log



## night (Sep 29, 2012)

I have some 90 lines of a "batch" file that I use to make configuration choices.  And to load packages.  The file is a *.sh file.  What CMD will log any errors to a log file?

MArk


----------



## night (Sep 29, 2012)

I can redirect everything to a text file.  But all I want is the errors redirected to a text file.  Is FreeBSD smart enough to do this?  I'm not.  At lest not yet.

Mark


----------



## DutchDaemon (Sep 30, 2012)

[cmd=]command 2>/path/to/error.log[/cmd]


----------



## night (Sep 30, 2012)

Is this used after every cmd?

zpool create zpool0 ad4s1d command 2>/path/to/error.log

Or 

command 2>/path/to/error.log
pkg_add -r gifsicle
pkg_add -r xorg

Thankyou for helping
Mark


----------



## jalla (Sep 30, 2012)

Use the second option and redirect stderr of your script. Commands in the script will inherit the filedescriptor.


----------



## night (Oct 1, 2012)

> Use the second option and redirect stderr of your script. Commands in the script will inherit the filedescriptor.


I'm sorry but you are speaking a different language.  I have no idea what to do.

Mark


----------



## DutchDaemon (Oct 1, 2012)

`script 2>/path/to/error.log`


----------



## jalla (Oct 1, 2012)

I suppose DD is more of a pedagogue than I am


----------



## NightTripper (Oct 2, 2012)

I still don't understand.  After every cmd or once for the whole script?

Mark


----------



## wblock@ (Oct 2, 2012)

Where did you get the script, and why isn't the author available to help you?


----------



## NightTripper (Oct 2, 2012)

I created the script.

Mark


----------

