for e in `catfile.txt`; doecho INSERT INTO \`omstest_omstest\`.\`GEN2_FIELD\` VALUES \(NULL, \'$e\', \'$e\', \'4\', \'2009-10-05 00:00:00\', \'0\'\'0\'\)\;; done;
if you take out the $ before each of the e's, I get exactly what I am looking for... except of course there is an e where I want the variable to be.
sk@svn:/tmp$ for e in `catfile.txt`; doecho INSERT INTO \`omstest_omstest\`.\`GEN2_FIELD\` VALUES \(NULL, \'$e\', \'$e\', \'4\', \'2009-10-05 00:00:00\', \'0\'\'0\'\)\;; done;
I'm using bash... No errors... but the moment I put a $var in place of the two e's, my output gets all jumbled up... and only the last line of the file prints correctly... it is almost like it is reading a new line that is not there... or at least that I am not seeing.
What shell did you use? Did you try it with more than one line in the test file?
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.