pls don't tell me how I could do this with perl; there's a req for sh. Have got a bunch of small multi line files that I thought I was reading in ok: /usr/local/apache/htdocs/rpts/rvd The first word of ea file is the only thing that makes it in. Cheers... pushcontent() { SECTIONID=4 THETITLE=$1 THECONTENT=$2 THECOUNTER=1 mysql -u root -D nuke <<EOF INSERT INTO seccont(artid,secid,title,content,counter) VALUES ('max(artid)','$SECTIONID','$THETITLE','$THECONTENT','$THECOUNTER'); EOF } x=`ls /usr/local/apache/htdocs/rpts/rvd` for a in $x do y=`cat /usr/local/apache/htdocs/rpts/rvd/$a` pushcontent $a $y done --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php