5.27.2006

netsh error - winsock corrupt

If you get this error when opening netsh:
Initialization Function InitHelperDll in IPMONTR.DLL failed to start with error code 11003

and it pauses for a long time before bringing up the netsh> prompt, then most likely the Winsock2 is corrupt, to recover delete the Winsock and Winsock2 subtrees from CurrentControlSet\Services and reboot, then reinstall TCPIP:  http://support.microsoft.com/kb/811259

5.23.2006

sum / total column adding in HPUX yields floating point notation

awk on HP-UX seems to use exponent notation instead of floating point notation like I'm used to in Tru64.  For example adding up (summing) a column in HPUX with large numbers yields an exponent number, not very useful to me.  To fix this behavior, use the OMFT variable in awk.  See the man page for awk for more info.

example:
ll /tmp| awk -v OFMT="%.f" 'sum += $5 {print sum}'

5.22.2006

convert LF to CRLF

Use the following to convert Unix to dos text files in cygwin on windows:
awk '{ print $0 "\r"}' unix.txt > dos.txt

source: http://www.datasavantconsulting.com/roland/tr.html

\r - carriage return
\n - line feed