Nmap Development mailing list archives
Re: Leading newlines in script output
From: Kris Katterjohn <katterjohn () gmail com>
Date: Wed, 29 Sep 2010 21:34:50 -0500
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/29/2010 09:29 PM, David Fifield wrote:
The code in formatScriptOutput strips leading newlines from the output (and my fix keeps it this way). I'm sure many script writers have been annoyed by this. To force the first line of output to be on a line after the script id, we have things like this: scripts/asn-query.nse: return (" \n%s"):format( table.concat( output, "\n" ) ) scripts/citrix-brute-xml.nse: return " \n" .. result scripts/qscan.nse: return " \n" .. report(stats) This trick of starting the output with whitespace to fool the newline remover is also used in stdnse.format_output. I can't think of a reason why we want newlines removed. Let's get rid of it?
Sounds good to me!
David Fifield
Cheers, Kris Katterjohn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMo/dKAAoJEEQxgFs5kUfuzO8QAJnoesCyC1SY60/M0YwvUTFc CFJ6h4xMVr5UuZijjUapAaSapDweIKAPDnZwNnPAsV3rOvmh1oKPafC/xA9p2aux ie0W4N+8HrctVz/C2hu7SpIlAZFtGESpKrXlO6x3XrSJa/WGXQFNiAQZBFEaApsk x73sOi5/Gqo0xVVYZ7CPKfyakIeY5Lxv7k5LFIcaRQkupNBkwaKYkREKEnXCCoIe GBoZ9B3/PgPk2HvBdyVFpPb3F9VtZ2pdG5MBuBKNzSOFrTx/d3dGWPYZTarQ4Lx9 Rxp63ZNaG54zmaMqdvA6hBL8tvFPRc8rkUxknYXjyAZdfyQyW7QNZSY1dMK3Epmm 2kd9bHAN0fxL1Hur+gAdC1+bDbeoowH6ANf+Ybq8PevlSRPpA1xoSFXo6PbIozGV 3aDq64ZNF1H41m642S/3Dd+6qsfxrPF5MRLUTkSKfdDXavWR+hecJF53uON1PY7X GkQoopSjOyUnzVuhQXlnupHhuUkIqtDd+bw+F2rBMR0FaoRkd6gXzBV/FDXeErgn FcHdG8SJuEk+7o5ZOZ+V7pT8tOUdAw6NQZvU50OeLVznc+iJPajwl9p+hra/LJ5d a0jaLgGlB5NC2VUevm24zuYlavqkf+8J6cPjN7p/j7XYtQEs/4OvXS8dmwH42tvV 7SYxe5di7ZnQ7CWlURmX =tgLH -----END PGP SIGNATURE----- _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Bug in script pipe output David Fifield (Sep 17)
- Leading newlines in script output David Fifield (Sep 29)
- Re: Leading newlines in script output Kris Katterjohn (Sep 29)
- Re: Leading newlines in script output David Fifield (Sep 29)
- Re: Leading newlines in script output Tom Sellers (Sep 30)
- Re: Leading newlines in script output Kris Katterjohn (Sep 29)
- Leading newlines in script output David Fifield (Sep 29)