in reply to She-bang confusion

inventory was written on a Windows box running cygwin, and I'm modifying and testing it on a Linux laptop

You are correct, I see that problem when the line endings are incorrect for the platform. You need to remove the \r from the line endings in *nix (Win \r\n ends a line - *nix \n ends a line). There are several examples on this site.

The other choice is to trasfer the files via FTP/SFTP/SCP and specifiy them a text/ascii and it will do the line termination conversion for you.



grep
Unix - where you can throw the manual on the keyboard and actually get a command