<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<span style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:black">I encountered this issue as well. I had to punt:<br>
<br>
# Re-run test that failed, only give more verbose test failure output.<br>
dhcpd -t -cf /tmp/dhcpconfmaint/dhcpd.conf.tmp > /tmp/dhcpconfmaint/dhcpd-t.fail 2>&1<br>
# Count lines in error output.<br>
fullerrorcount=`wc -l < /tmp/dhcpconfmaint/dhcpd-t.fail`<br>
# Determine lines without top header<br>
withouttopheader=$(( $fullerrorcount - 4 ))<br>
# Determine lines without bottom header<br>
withoutbottomheader=$(( $withouttopheader - 18 ))<br>
tail -$withouttopheader /tmp/dhcpconfmaint/dhcpd-t.fail | head -$withoutbottomheader<br>
<br>
<span style="color:black">-----Original Message----- <br>
<b>From:</b> İbrahim Ercan [ibrahim.ercan@engineer.com]<br>
<b>Received:</b> Monday, 14 Jan 2013, 5:14<br>
<b>To:</b> dhcp-users@lists.isc.org [dhcp-users@lists.isc.org]<br>
<b>Subject:</b> Getting exact error from dhcpd config test<br>
<br>
</span></span>
<div>
<div dir="ltr">Hi. As I mention on this question ( <a href="http://stackoverflow.com/questions/13878706/how-can-i-check-dhcpd-conf-against-syntax-error-without-running-dhcpd">http://stackoverflow.com/questions/13878706/how-can-i-check-dhcpd-conf-against-syntax-error-without-running-dhcpd</a>
), I want to get exact error from dhcpd -t -cf command.<br>
<br>
I tried dhcpd -q -t -cf <file> but this prints nothing. Do I have to use regex? Or is there any way to print only what error is?<br>
<br>
--<br>
Ibrahim Ercan<br>
</div>
</div>
</body>
</html>